texts: Does the Altium model of this relay match the datasheet? TX2-5V - Solved - No

texts:
Altium offers this model when a Manufacturer part search is done for a Panasonic TX2-5V, notice that in the un-energized state pins 8 and 9 as well as 3 and 4 are contacted in the model.

The datasheet has the un-energize state of 9 and 10 being contacted. I want to make sure that I'm not mis-understanding something in the datasheet but I feel that the Altium model is incorrect.

https://www3.panasonic.biz/ac/cdn/e/control/relay/signal/catalog/mech_eng_tx.pdf

Am I seeing it correctly?

From the Altium model

From the Panasonic datasheet


texts:
Does anyone know if SPI typically draws more current than I2C? The reason I'm asking is that I'm playing with the LIS3DH accelerometer and driving it with an Arduino. When I2C is used, the current draw is about 30uA (300uV across a 10R shunt). This is achieved with SDO connected to VDD rather than GND. However, when SPI is used, the current draw is about 300uA (3mV across a 10R shunt).

Because I2C doesn't use SDO, it could be connected to VDD to reduce current draw. The same cannot be done when SPI is used since SDO is used - correct? I wonder if SDO somehow drains current.

Any help will be appreciated.

Thanks


texts: Restricting movement of a DC motor ( replicating high load by holding it)

texts:
I am testing a p-magnet split-ring commutator DC motor with an ideal DC 9V power supply I am curious to find out why the results are like they are,
so, when the motor was restricted as if it has a high load, I got a graph where the curve of current increases with time then becomes steady at 3A, why did current take time to reach the final value?, I let the motor flow again without the load (rotating rapidly) and the final current value it reaches is lower than before, why is that?
Thank you


texts: Converting -48 VDC to +12 or +24 VDC 10 Amps or more

texts:
Good day,

I would like the simplest way to reliably convert -48 VDC (Telcom DC Plant -42 through -56) to either +12 VDC or +24 VDC, the crux is I need at least 10 Amps.

What I am trying to do is build an LED Strip Lighting controller powered from the Telcom DC Plant. These Strips could be up to 10 Meters (Average length of an Aisle).

I'm thinking a switched buck converter but am open to any / all ideas.

Thank you in advance


texts:
I have two MCP 4822 DACs with a dspic33fj128mc804. The initialization of both the DACs is getting done as required. However, when I try to change the values to be written on the DAC they don't get changed. The value stays same as the initialized value.

Below is my code. Can anyone please help me with this , please?

//Initialize DAC

void initDACs(void)
    {
    TRISB&=~0x4010;
    DAC1CS=DAC2CS=1;
    _SPI1IF = 0; // Clear the interrupt flag
    _SPI1IE = 0; // Disable the interrupt

//Initialize SPI

SPI1CON1=0x073e; //16bit, master, prescale 4, CKP0 CKE1 SMP 1

SPI1STAT=0x8000; //enable SPI

DAC1CS=DAC2CS=0;
SPI1BUF = 0x3000;   //Set output of A to 0V
while(!_SPI1IF); //wait until SPI has finished
_SPI1IF = 0;
DAC1CS=DAC2CS=1;

SPI1STAT &=~0x40;
_SPI1IF = 0;

DAC1CS=DAC2CS=0;
SPI1BUF = 0xb000; // Set output of B to 0V
_SPI1IE = 1;

spiReady=0;

}

// Function to set values on the DAC

void channelSetDAC(int v, int ch)
{

unsigned int sendData;

if(ch>4) return;
if (SPI1STATbits.SPITBF) return;

if(ch &1)
{
sendData= 0x3000 | (v & 0xfff);

}
else
{
sendData= 0xb000 | (v & 0xfff);
}

if (ch <3) DAC1CS=0; else DAC2CS=0;

SPI1BUF=sendData;
spiReady=0;

}

// Function to write values on the DAC

void sMethod()
{
    channelSetDAC(0x7d0,0);
}


texts:
I have a toy for my son, it's great but it flies round and round in the dark,  I was thinking of sticking an LED on it like we used to do at school - back then LED's were rubbish but they had long legs and were designed for electronics and soldering - I am 43 now - but I remember we had to calculate the resistance put in a resistor and then it wouldn't blow the LED .. we made a fuse tester back then..

since then LED's have changed markedly.. but is there still a "brand/family" of LED .. a single stand LED... that will plug straight into a 1.5v AA without blowing that comes with REALLY long wire legs so I can solder it direct to the terminals of the AA battery in series, and fit it into the battery enclosure simply by putting the battery cover on top of it? and do they still come with thin stiff wire long metal legs that can be bent, hold a shape and remain put?

OR. If I need a resister in series what is the resistor I need can someone help me calculate?

and also, they are still a diode, are they forgiving of the polarity or will they blow if placed the wrong way round?


texts: Antenna conterpoise or ground plane. Confused about length requirements

texts:
I have an appliation where i need to mount a multiband (VHF/UHF/700/800/900 MHZ) mobile antenna (picture 2) on a tower.  The spec sheet for the antenna says it used a 4 foot diameter ground plane for testing.  I'm considering using a mobile to base converson kit like the one in the picture with a radial ground plane or counterpoise.  My question is on the size I need.
From the way I thought I understand the theory, the radials act as a reflective ground, and should be at least 1/4 wavelenth of the antenna frequency.  So is there a situation where the radials would be too long?
I'm thinking I should use radials that are 1/4 wave length of the VHF frequency, and that the extra length when operating at the UHF and higher frequencies would not negitivly impact operation.  Is my reasoning correct?
Also, will I need some sort of balun?


texts: Is this Opto-coupler + MOSFET + Relay schematic correct for my application?

texts:
I have an ESP32, with a floating voltage supply with 3.3V.

I want to use it's GPIO to turn on/off a solenoid valve that works at 12V and draws a current of about 2A.

I figured that a proper way of doing this is by using a relay, since the load is inductive and I want to be extra careful and protect my MCU, I also want my project to not get too hot. I see that I could use a mosfet for this but I think that those could dissipate more power than a relay would.

I'll be using a very similar circuit to this one but for a Pump that works at 12V with a current draw of about 8 Amps as well. I still haven't looked for the proper components for that one yet.

Please take a look at my circuit and let me know if you guys see something that is off or incorrect, thank you very much in advance.

PS: I considered using Solid State Relays but I find them quite expensive so I discarded them


texts: Simple open source ALU written in Verilog

texts: I am working on a control unit as a project in my Verilog class. To get some burden off of me, I want to designed everything considering I have a 8051 type simple ALU already with me so I can work on the control unit only. But I am not really able to find verilog ALU code which is open source too. Where can one find this type of code?


texts: Eliminating humming from switched audio jack

texts:
I'm using a simple DPDT 3.5 audio jack to attempt to switch between two audio outputs - speakers with a built in amplifier and headphones. The speakers work just fine, but when the headphones are plugged in, my current design leaves the signal floating on the speakers so naturally there is quite a hum, even as far as still being able to hear the music.
This is the type of switch I'm using:

The jack is wired:

Grounds all tied together to pin 1
Audio in from the sound card to pins 2 and 3
Speakers on pins 4 and 5

And the overall diagram of how things are set up:

What should I do to eliminate this noise?
I've tried adding a large resistor between ground and speaker signal but I found that if the resistor was small enough to be effective it caused noticeable problems when the headphones were unplugged. My other thoughts were: should I have a capacitor somewhere? Or instead of switching the signal directly, could I detect the plugging in of the headphones and switch off the power to the speakers completely?


texts:
I mistakenly connected a power charger in series with my ceiling led lights... oh... whell... the reality is more complex, but essentially:
1) when the switch is off, the phone power charger is in series with the lights, the lights do switch off in this case (I presume because of too low voltage), and the charger works correctly
2) when the switch is on, the phone charger is shorted and goes off, but the led lights go on correctly.

The scenario 2 is of little interest to me.

Of course when in 1) they are in series they will not get 220V* each as normal/parallel connection, but a smaller portion. (*I am in europe)

It is my understanding that an electronic device may try to draw more current if working under lower voltage than what it should get, in order to generate the same amount of Watts and operate correctly.

In short: I am concerned about the power consumption in scenario 1).
This is 99% of the time of course, and the main concern is that electricity will have to go through the led bulbs evenduring the 99% of the time while they are off.

Can anyone help?

Leds are non dimmable if that makes a difference, the mobile charger is of course 220/120v  , this is hardwired in behind the wall, so no risk of someone coming in and connecting their hair dryer in place of it :D

Thanks for any help!!


texts: Could someone please explain to me when and why should we add a voltage divider at the inverting input of a Schmidtt Trigger?


texts: Diode voltage rate of change and junction capacitance

texts:
I was looking through some schottky diodes and saw in their datasheets, that they have characteristic called voltage change of rate [dv/dt]. Most of those I saw have it exactlly 10000. Now, in datasheets, they also specify their junction capacitances, which differ from diode to diode.

My questions are:

What is voltage change of rate, what does it mean? And how come, they have it exactlly the same?
Why is junction capacitance in graphs usually a function of reverse voltage and not forward current or something?

EDIT:

I am actually asking for a way to compare these diodes, to figure out which is faster and which would fit my needs.


texts: What does it mean by RESISTORAXIAL-0.3 in EAGLE Sparkfun resistor library?

texts: This may be a childish question but I don't know what does it mean by RESISTORAXIAL-0.3 in EAGLE Sparkfun resistor library. Is it some kind of measurement? I am new in EAGLE as well as PCB designing!


texts: What is the difference between 4-leg and 2-leg momentary tactile switch?

texts:
After many search, I don't know still that what is exactly the difference between 4-leg and 2-leg momentary tactile switch?

4-leg:

2-leg:

Why do they use 4-leg in many cases? for example, in mobile phones, in many cases, they use 4-leg. look:


texts: How to calculate the output impedance of the BJT in a Common Collector Amplifier?

texts:
The book I am reading from (Electronic Devices and Circuits by David A Bell) analyzes the Common Collector circuit by using a H-parameter model as shown.

My confusion is in understanding the output impedance of the transistor. By looking at the circuit, I find the output impedance of the BJT to be RE(since [RE||{1/hoc}]~RE). But the book seems to disagree. To find the output impedance of the transistor it looks like the AC input source has to be shorted, the current due to hrcvo (which is ~vo since hrc~1) should be taken as Ib now and then the Ie corresponding to this Ib is used to arrive at the output impedance as shown below.

Why should we do all of this and not just take RE as the output impedance? I understand that there is a feedback from the output to the input of the amplifier but isn't the value of RE (and hence Ze) independent of that since we choose it to properly fix the operating point of the BJT?


texts: How to calculate voltage ripple in a BLDC filter module?

texts:
Hi

I need some calculation for my thesis. A found this picture on the internet. My project is almost the same.
It's a pi filter for a 3 phase BLDC. The peak current is 60A. It runs from 12V car battery.
I need to design a filter which can handle the sudden current demand, while the voltage ripple is not too large on either side.

How should I choose the values and calculate the voltage ripple?
Thank you for any help!


texts: Any good suggestions for Basys2 optional oscillator 50 MHz or 100 MHz?

texts: I want to get the optional stable oscillator for the Basys-2 but don't know which would be the best choice for 50 MHz and 100 MHz? Has anyone bought and used any? If so, what is the part number?


texts: How to determine forward voltage for overdriven LEDs

texts:
I'm trying to figure out how to determine the forward voltage and forward current for overdriven LEDs, and need a bit of help understanding what are the dependent variables and which are independent variables.

For a normal 3mm LED, I understand that I'd set the forward current by looking at the typical forward voltage (usually between 2.0 and 3.5 volts or so), the typical forward current (usually 20-25 mA), and the supply voltage.  I'd calculate the remaining voltage and then divide by the desired current to get a resistance value; usually I find these to be like 100-200 ohms or so with a 5V supply.

The problem that I'm working with now is that I'm attempting to overdrive LEDs by a factor of 50x-100x (so, running up to 2 amps through an LED in 100 us pulses, for a duty cycle of 0.01%).  I've seen papers suggesting that this should be possible, but I'm having trouble figuring out how to compute the resistance values.

I'm using a circuit, as shown below, to drive the LEDs:

The supply voltage is around 12 Volts, so the capacitors charge up to 12 volts, and then dump current through the LEDs.  I want a resistor R2 to regulate the current and provide me a way to measure the current going through the LEDs.

I'm having trouble figuring out what the resistor value should be, because the forward voltage and forward current are both related -- if I try to drive them beyond their "typical" current, the forward voltage should comparatively increase.

The I-V curve for these LEDs is as shown below:

I feel like I'm in a bit of a chicken and egg scenario, where I don't know how to find the forward voltage without knowing the current, or the current without knowing the forward voltage.

How should I approach deciding the value of resistor R2?


texts: Is there any point in using a big crystal over a smaller one? Apart from the tolerance spec, how come crystal manufacturers have all these different models of crystals from really tiny ones to big ones? I don't think I know the advantage to using a big crystal.


texts: How to measure Alkaline battery lifetime/capacity in practice LED circuit?

texts:
I have a LED light uses three 1.5V ALKALINE batteries in series. However, the capacity of the battery is not marking. When I put a multimeter in series with these three batteries and turn on the LED, the current is 76mA. I also measured the voltage between the LEDs and it is 2.77V.

If I assume the capacity of the batteries is 2200mAh (I found it on WIKI, it said for alkaline batteries, the capacity under 50mA constant drain is 1800~2600mAh).

My question is, what is the lifetime of this LED light?
Can I calculate this from 2200mAh/76mA=28.94h? Or it is also affect by LED working voltage? The other part in the LED circuit is just a PIR sensor, I think it won't draw much current.


texts: Higher than expected voltage in RC low pass filter

texts:
I attempted to check the myth about fixing the P0420 error code (Insufficient efficiency of catalytic converter [$3000 part from Toyota]) by inserting a low pass RC filter between an ECU and a downstream oxygen sensor.
The sensor is connected with 4 wires: two for the internal heater, ground, and signal. The sensor generates a signal between 0.1 and 0.9 volts depending on the level of oxygen remaining in the exhaust gasses after the catalytic converter. If the ECU sees wild swings in the signal, it lights up a check engine light.
In some states which care too much about the ecology, it creates unnecessary waste in the form of a perfectly good car being junked, in the rest of the world, the "Check Engine" light always on masks other, potentially important error codes.
I inserted 1MΩ into the break in the signal wire, and 1uF electrolytic capacitor between the signal and the ground wire with the "-" side towards the ground. The capacitor is inserted on the side of the resistor closer to the ECU. Now both, the ECU and the voltmeter between the signal on the ECU side and the ground show a constant 1.28 volts. It is higher than the expected range of 0.1v - 0.9v therefore trows a "Voltage too high error".
In my understanding from some EET classes taken more than a decade ago, I should not see a voltage higher than 0.9volts in any way I connect passive elements and a voltmeter. What I am missing?

simulate this circuit – Schematic created using CircuitLab


texts: Long and short button press with stm32f0

texts:
I'm trying to understand timer of stm32f0 without using the stm library, in particular I'm using the stmf051 discovery board.

What I'm trying to do is a simple program that detect when a button is short pressed or long pressed.

So the program would be simply start a counter  when the microcontroller, detect a button is pressed and if the ARR (auto reload value) reach the limit, light the green led in the board otherwise, turn on the blue led in the board.

What came up so far looking at the example in the datasheet and in this  web site,  is this piece of code, that it works but there are some problem of debouncing (I've update the code and now the problem of debouncing is solved), and I'm not satisfied with it.

So please can you help me to improve my code,  or show me a better way to do it, or simply point me in the right direction.

Thank you for your time, and sorry for my bad english.

    #include "stm32f0xx.h"

    short buttonPressed(void);
    void delay(int a);

    int main(void)
    {

        /* Enable the GPIO A,C,B */
        RCC->AHBENR |=
                (RCC_AHBENR_GPIOCEN | RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN);

        // Enable Timer TIM2
        RCC->APB1ENR |= RCC_APB1ENR_TIM2EN;

        TIM2->PSC = 23999;          // Set prescaler to 24 000 (PSC + 1)
        TIM2->ARR = 800;            // Auto reload value 800, for activate the green
                                    // led you need to push the botton for at least 800 ms

        TIM2->CR1 = TIM_CR1_CEN;    // Enable timer

        /* Configure PC8 and PC9 in output  mode (led green and blue) */
        GPIOC->MODER |= (GPIO_MODER_MODER8_0 | GPIO_MODER_MODER9_0);

        /* Button Pin PA0 in alternate function (user button in the board)*/
        GPIOC->OTYPER &= ~(GPIO_OTYPER_OT_8 | ~GPIO_OTYPER_OT_9);

        //Ensure maximum speed setting (even though it is unnecessary)
        GPIOC->OSPEEDR |= (GPIO_OSPEEDER_OSPEEDR8 | GPIO_OSPEEDER_OSPEEDR9);

        //Ensure all pull up pull down resistors are disabled
        GPIOC->PUPDR &= ~(GPIO_PUPDR_PUPDR8 | GPIO_PUPDR_PUPDR9);

        while (1)
        {
            short answer = buttonPressed();

            if (answer == 1)
            {

                GPIOC->BSRR = (1 << 9); // Blink the led in PC9 if the button is
                delay(300000);          //  long pressed
                GPIOC->BRR = (1 << 9);  //
            }
            if (answer == 2)
            {
                GPIOC->BSRR = (1 << 8); // Blink the led in PC9 if the button is
                delay(300000);          // short pressed
                GPIOC->BRR = (1 << 8);  //
            }

        }

        return 0;
    }
    short buttonPressed()
{
    short return_value = 0;

    if (GPIOA->IDR & GPIO_IDR_0)        // If the button is pressed
    {
        delay(80000);
        if (GPIOA->IDR | GPIO_IDR_0)
        {
            TIM2->EGR |= TIM_EGR_UG;       // For an update generation with UG=1
            TIM2->SR &= ~TIM_SR_UIF;       // Clear TIM_ENV update interrupt so the ARR start from 0
            while (GPIOA->IDR & GPIO_IDR_0)
            {
            }               // Don't do anything until the button is released

            if (TIM2->SR & TIM_SR_UIF) // If ARR reached 800 it means that it the button was long pressed
            {
                return_value = 1;
                TIM2->SR &= ~TIM_SR_UIF;    // Clear the ENV register

            }
            else                    // otherwise the button was short pressed
            {
                return_value = 2;
                TIM2->SR &= ~TIM_SR_UIF;    // Clear the ENV register
            }
        }

    }
    return return_value;
}

    void delay(int a)
    {
        volatile int i, j;

        for (i = 0; i < a; i++)
        {
            j++;
        }

        return;
    }


texts: Confusion on dimensioning power supply and fuse for a motor

texts:
I have the servo-motor model called MAC140. Here is a long manual including all other types of motors of the same company:
http://www.jvl.dk/files/pdf-1/user%20manuals/lb0047gb.pdf

If I go to section 5.1 of this manual, there is a section about the ratings of the motor models including MAC140. Here I uploaded it below for simplicity(Just left-click on it to make it bigger):

First of all, this motor has a rated power 134W. And as you can see, under the current consumption section there are two currents mentioned: average current consumption and peak supply current.

And in case of MAC140, what I understand is: when using a 24VDC supply the nominal rpm is 2000 and nominal current is 6A(Here also explains: http://www.jvl.dk/default.asp?Action=Details&Item=579). And there is also 16A peak current mentioned. I encircled this part with red.

But unlike the previous info, here the same motor is rated 160W and 6.3A http://www.jvl.dk/default.asp?Action=Details&Item=579

I want to use 24VDC and confused about the suitable power supply current. Do I need a power supply which can provide 6A or 16A? And what fuse should I use?

edit: And I guess if I connect lets say 3 motors to the same supply, I need a 24VDC supply with would have 3 times more current?


texts: The issues of common ground with voltmeter and ammeters

texts:
Apologies if this post is, yet again, another noob in electronics. I have an engineering degree in audio but have newly found a passion for electronics and am teaching myself as I go.
I am trying to build a benchtop power supply from an old ATX power supply I have laying around.
I have tested the ATX supply, as well as done research and know that there is a common ground amongst all outputs of the supply.
I recently bought 3 x 100V 50A voltmeter ammeters.
Specifications:
Wiring voltage: 4.5-30V DC
Note: The maximum input voltage can not exceed 30V, otherwise there is the danger of burning
Working current: ≤20mA
Measuring range: DC 0-100V 0-50A
Minimum resolution (V): 0.1V
Refresh rate: ≥100mS / times
Measure accuracy: 1% (± 1 digit)
Minimum resolution (A): 0.01A
Operating temperature: -15 to 70° c

I would like to have 3 sets of bindings posts, this will be my "load", 12V, 5V and 3.3V. Each circuit will have its own voltmeter ammeter. I know the issue, but also the reason they're so inexpensive, is that the shunt is connected to the negative side of the load, and I know this can be a major issue because all the outputs have a common ground. I'm just not sure WHY it's an issue.
I considered placing respectable relays (controlled with a toggle switch) within the negative of each shunt to be able to disconnect the meters which I am not using. But this would then in turn mean I am not able to use more than one output at a time.
I have thought about these 2 options but I am not sure if they will solve the issue because the meters are still linked to the common ground:

I can connect the 5V and 12V voltmeter ammeter's power input to their DC supply voltage (running to the load) from the ATX supply, since the power input of the meter needs to be between 4.5 - 30V, and the 3.3V I can connected to a seperate 5V supply line which I take from the ATX too.
I can connect all meters to a seperate supply voltage I take from the ATX. I.e. each meter has a supply voltage for its power in (1 x 12V line and 2 x 5V line) and each has s supply voltage running to its load.

Please forgive me, I have not drawn up any schematics because I'm not sure if this will even work.
MY QUESTIONS ARE

Why is common ground an issue when it comes to the meters? Is it to do with shorting of the shunts? I don't have a thorough understanding of the issue and thus cannot solve the problem.
If I galvanically isolated the supply voltage of the power input of each meter would this help solve the issue?
If I have 3 circuits but only one circuit had a meter, would that meter be affected if the other 2 circuits operated at the same time (with a load on them?)

Please help. I'm sorry if my post is not clear. If I must draw up some schematics I can, although they'd be rudimentary.


texts: How to overwrite flash memory on STM32L series

texts:
I am trying to write a known pattern (ie 0xFFFFFFFF or 0x00000000) on top of already written flash memory, to invalidate portions of it for a primitive file system. But it doesn't work for me on the STM32L series as it does on the STM32F series.

I am used to the STM32F family of microcontrollers, where the flash memory is erased to 0xFFFFFFFF and written with 0's.  You can write anything you want to erase memory, ie

 write 0x00001234 on top of 0xFFFFFFFF -> 0x00001234

and you can write 0x00000000 (all zeros) on top of anything

 write 0x00000000 on top of 0x00001234 -> 0x0000000

I am now using the STM32L family (low power), and the flash memory is totally different. It is erased to 0x00000000, and written with 1's. However, I don't know how to reliably write all ones.  For example, if I erase, I can do this

 write 0x01020304 on top of 0x00000000 -> 0x01020304

but if I try

 write 0xFFFFFFFF on top of 0x01020304 -> 0xFFFFFFBF !!!

Note that the final answer has a B in it. It is not all ones. In fact, if I write bytes 0x00 to 0xFF to a freshly erased page of memory, and then write 0xFFFFFFFFFF all over it, I get very glitchy results:

ff ff ff bf ff ff ff ff ff ff ff ff ff ff ff fb
f7 ff ff ff fd ff ff ff ff ff ff f7 ff ff ff ff
fe ff ff ff ff ff ff ff ff ff ff 7f f7 ff ff ff
ff ff ff fb ff ff ff ef ff ff ff ff ff ff ff df
fe ff ff ff ff ff ff ff ff ff ff 7f f7 ff ff ff
ff ff ff fb ff ff ff ef ff ff ff ff ff ff ff ff
ff ff ff bf ff ff ff ff ff ff ff ff ff ff ff fb
f7 ff ff ff fd ff ff ff ff ff ff f7 ff ff ff df
f7 ff ff ff fd ff ff ff ff ff ff f7 fe ff ff ff
ff ff ff bf ff ff ff ff ff ff ff ff fd ff ff ff
ff ff ff fb ff ff ff ef ff ff ff ff ff ff ff bf
fe ff ff ff ff ff ff ff ff ff ff 7f fb ff ff ff
ff ff ff fb ff ff ff ef ff ff ff ff ff ff ff bf
fe ff ff ff ff ff ff ff ff ff ff 7f ff ff ff ef
f7 ff ff ff fd ff ff ff ff ff ff f7 fe ff ff ff
ff ff ff bf ff ff ff ff ff ff ff ff fb ff ff ff

Here is the pseudo code I am using (FlashWrite is a wrapper around the STM std periph library).  I tried writing a  pattern of 8 writes with the bits shifted <<1 each time, and that actually gave me what I wanted (all ones) but I am not sure this is reliable.

 uint32_t pattern = 0x04030201;
 FlashErasePage(0x0801E000,FLASH_PASSWORD);
 for(int j=0;j<64;j++) {
    FlashWriteArray(0x0801E000 + 4*j,(uint8_t*)&pattern,4);
    pattern += 0x04040404;
 }

 for(int j=0;j<64;j++) {
#if 1
     // write once
     uint32_t pattern = 0xFFFFFFFF;
     FlashWriteArray(0x0801E000 + 4*j,(uint8_t*)&pattern,4);
#else
     // write shifting bit pattern
     uint32_t pattern = 0x01010101;
     for(int i=0;i<8;i++) {
        FlashWriteArray(0x0801E000 + 4*j,(uint8_t*)&pattern,4);
        pattern <<=1;
     }
#endif


texts: microcontroller doesn't work with Nokia 5110 LCD (PCD8544)

texts:
I'm struggling with my first AVR microcontroller - AtTiny85 to make it work with the known Nokia 5110 display. I wrote my own code to handle the LCD, it didn't work. Then I tried a code found somewhere on the Internet, it supposed to handle the display, but it didn't too. I though that my display is broken, but I attached it to Raspberry Pi and executed an Adafruit script - it worked without any problems.

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

#define PIN_SCE PB0
#define PIN_RESET PB1
#define PIN_DC PB2
#define PIN_SCLK PB3
#define PIN_MOSI PB4

enum
{
    FUNCTION_SET = 0x20,
    FS_CHIP_POWERDOWN = 0x4,
    FS_VERTICAL_ADDR = 0x2,
    FS_EXTENDED_INSTR = 0x1,

    DISPLAY_NORMAL = 0xc,
    DISPLAY_BLANK = 0x8,
    DISPLAY_ALL_ON = 0x9,
    DISPLAY_INVERSE = 0xd,

    DRAM_SET_X = 0x80,
    DRAM_SET_Y = 0x40,
};

void BitTransfer(uint8_t Bits)
{
    PORTB &= ~(1 << PIN_SCE);
    int8_t i;
    for(i = 7; i>=0; i--)
    {
        if((Bits >> i) & 1)
            PORTB |= (1 << PIN_MOSI);
        else
           PORTB &= ~(1 << PIN_MOSI);

        PORTB |= (1 << PIN_SCLK);
        _delay_us(10);
        PORTB &= ~(1 << PIN_SCLK);
        _delay_us(10);
    }
    PORTB &= ~(1 << PIN_MOSI);
    PORTB |= (1 << PIN_SCE);
}

void SendCommand(uint8_t Command)
{
    PORTB &= ~(1 << PIN_DC);
    BitTransfer(Command);
}

void SendData(uint8_t Data)
{
    PORTB |= (1 << PIN_DC);
    BitTransfer(Data);
}

int main(void)
{
    DDRB |= (1 << PIN_SCE);
    DDRB |= (1 << PIN_RESET);
    DDRB |= (1 << PIN_DC);
    DDRB |= (1 << PIN_SCLK);
    DDRB |= (1 << PIN_MOSI);
    PORTB = 0;
    _delay_us(10);
    PORTB |= (1 << PIN_RESET);
    PORTB |= (1 << PIN_SCE);
    _delay_us(10);

    SendCommand(FUNCTION_SET | FS_EXTENDED_INSTR);
    SendCommand(0xa5); // VOP
    SendCommand(0x06); // temp coefficient
    SendCommand(0x13); // BIAS
    SendCommand(FUNCTION_SET);
    SendCommand(DISPLAY_ALL_ON);
    while(1)
    {
    }

    return 0;
}

I power my AVR using 3.3v pinout of Raspberry Pi, same with the LCD. The AVR is working at 1 MHz frequency.
When I disconnect the plug leading to the ground, a black line appears on the screen for a short while.
I don't know, maybe it's a hardware problem?


texts: Do dimmer switches work properly with any kind of lamp?

texts:
I have a dimmer switch installed in my room that I like very much, but lately incandescent lamps became harder to find, and soon (in a few years or so, if I'm not mistaken) they will be gone to be succeeded by other kinds of lamps.

My question is will LED and fluorescent lamps work with dimmer switches properly?


texts: What device can switch ON and OFF different pads independently?

texts:
I am looking for a device, but I am not sure what I need: maybe you have ideas.
I have a power supply connected to 16 electrodes. What I need is a device (see picture) between the power supply and the electrodes that allows me to switch ON and OFF independently each connection to each electrode. The switching time may be different for each of them (between 10 and 100 ms).  The voltage needed is between 2 and 5 V.

How can I realize such a device?


texts:
Using this shecmatic to drive some relays - works fione for a while then the relays start misbhaving. I'm a moron - the PCF is  current based output thingy not a simple "heres 5v or 0v" for the ULN to work with.

As a result (of me not really reading the dtatasheet all that carefully) the base of the transistors in the ULN sit at around 2v when "on" - thats my issue! - So here's the question(s)

Is there a hack I can do to this circuit (its laid onto a PCB proto) that will make it work for now? Something simple like a pullup/or something?
Keeping the PCF to give my my "signals" what would you recommend as an output low side switch (as I am guessing the internal resistors in the ULN/transistor specs of the ULN are the issue) to drive some simple 12v automotive relays - maybe a hexfet or something?
is there a replacement device that fits the PCF footprint, shares the same logic etc, but does a simple "heres 5v or 0v" output to drive the ULN properly?

Looking forward to some advice! Thanks in advance!


texts: Free Piston Stirling Engine Tuning Capacitor - Series Vs Parallel

texts:
Why is a tuning capacitor placed in series with a free piston stirling alternator rather than parallel with it?

I am accustomed to seeing power factor correction capacitors placed in parallel in school rather than in series, why would this application be different?

To be honest I have never seen an example of power factor correction being used on an AC source, only on AC loads so maybe that has something to do with it.

Also, it's called a tuning capacitor, so maybe it has something to do with controlling the resonance of the engine piston (RLC circuit)? I know that both the piston and displacer must have the correct resonant frequency in order for the engine to operate correctly.

EDIT: I just found some more info about about the multiple purposes of a tuning capacitor in "Tradeoff Between Magnet Volume and Tuning Capacitor in a Free Piston Stirling Engine Power Generation System" (https://doi.org/10.4271/929262) This paper doesn't really answer my question, though.


texts:
I have a bunch of LED Lamps from a yellow swedish furniture market.
At that time they are connected with wireless power switches (Based on 433MHz). That is quite nice because I can control them from everywhere in my flat - but I can only SWITCH them. Want I really want to do is dim them.

I already found some Threads in the internet that say there are two types of that lamp. That one you can control and that one that already has a built in controller.

I dissambled one of mine but have no clue which one I have.

What is C1, U1 and U2? can I just attach the black and white wires to a transistor, that is fed with 4V using some LMxxx IC (or even connect 3 of them in a row an power them with 12V) and dim them using PWM that is generated by my Arduino?

This is the Head with the LED in the middle:

And this is the Power Source:


texts:
When you are sending bits or voltage's through a coaxial cable from 1 PC to another PC, does current flow from PC1 to PC2 through the cable?
If so, mustn't there be a complete circuit?


texts:
I am pretty sure that this should be simple but the answer is eluding me.

Basically I would like a simple 12V DC circuit that lights one LED (red) when a power switch to a pump is off and would light a second LED (green) when the switch is on.

This seems trivial except that I cannot have the wrong LED illuminated in the wrong condition.


texts: Power consumption in voltage multipliers

texts:
Cockcroft–Walton generators and Marx generators are voltage multipliers. These circuits contain various diodes, capacitors and resistors that charge the capacitors in parallel and then put them in series to multiply the voltage. How much do these circuits consume?
I saw videos on youtube that create 180kV sparks using a 9V battery.
EDITED: here's schematic Cockcroft–Walton generator:

Marx generator:


texts:
So, I was changing some thermal material on my Sony A5100 camera, but somehow must've damaged one of the chips (below). Right now, the LCD display has a slight green tint to it.
I swapped an LCD screen for a new one, but the green tint remains (the video recorded is 100% fine.)
I'm assuming it's something having to do with this damaged chip since all 7 of the other ones that are near it are close to the LCD flex connector (shown below).
Can someone help me identify this chip? Also, how difficult would it be to solder a new one on the motherboard?
(Also it seems that this particular chip doesn't have connections to it on PCB like the rest of the chips? The wires go around it — if that helps with anything).

Thanks in advance!


texts: How to reduce 5 volts to 4 volts 1.5Amp with minimum components used?

texts:
I am trying to reduce 5 volts high current source to 4 volts with at least 1.5 amperes. I searched the internet, but I could not find 3 pin voltage regulator, 5V(in) 4V(out)voltage regulator.
I think voltage divider is an option, but it consumes lots of power,
LMZ12002 is an option but it requires at least 9 components.

Is there other options?


texts: Actual electric potential at terminals of battery

texts:
I understand that a 9V battery will produce an electrical potential difference/voltage of 9v across the positive and negative terminal, with the positive terminal having the higher potential by definition.

I am aware that the actual electric potential at the positive terminal may not be 9V or 0V for the negative terminal but the difference in the electric potential is 9v.

Wikipedia tells me that the electric potential of a point is the amount of energy needed to move a unit positive charge from a reference point, usually infinity, to that point. I do not understand how this relates to circuits.

My question is really what is meant by the actual electric potential at the terminals of each battery and is it possible to measure?

thanks


texts:
I am currently trying to port the functionality of one of my projects from an Arduino to a PIC µC. To begin I wanted to establish a UART communication to my computer but I cannot get it to work. I tried with an TTL to USB converter and now with a logic analyzer to see if anything happens on the wire but there is nothing. I read in the datasheet the tx pin should be RC6 and I set all registers mentioned in the datasheet or in many tutorials and tried to understand them but I seem to forget something. Has anyone of you an idea?

main.c

#define _XTAL_FREQ 16000000
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>

#include "uart.h"

int main(void)
{

    OSCCON = 0x7B;
    UART_Init(9600);

    while(1){
        UART_Write('c');
        UART_Write('w');

    }
}

uart.h

char UART_Init(const long int baudrate)
{
  unsigned int x;
  x = _XTAL_FREQ/(64*baudrate)-1;
  if(x>255){
  x = _XTAL_FREQ/(16*baudrate)-1;
  TX1STAbits.BRGH = 1;
  }
  if(x<256){
    TX1STAbits.TXEN = 1;
    TX1STAbits.SYNC = 0;
    RC1STAbits.SPEN = 1;
    SP1BRG = x;

    return 1;
  }
  return 0;
}

void UART_Write(char data)
{
  while(!TX1STAbits.TRMT);
  TX1REG = data;
}


texts: Driving proportional valves from microcontroller

texts:
I am looking to drive a current regulated proportional (solenoid) valve that needs up to 85mA @ 24V from a microcontroller.

So far I found this circuit that looks pretty straightforward:

What are other low cost options? Is there such a thing as a programmable current source that I can drive through SPI or I2C? So far I wasn't able to find one.


texts:
I am trying to replace the battery in a handheld recorder (m-audio microtrack). I am following this guide. The guide instructs to use a 3.7V battery, and this value is the same as written on the original battery which I pulled out of the device. I am trying to turn the device on with a Li-Ion battery that I took from a mobile phone - the battery is also rated 3.7V, is fully charged and functional - the mobile phone works OK and indicates a fully charged battery. However, the device is not turned on (polarity is correct).

I measured the output voltage of both batteries, and the original reads 4.15V with open terminals, and about 4V with load (the device connected and turned on). On the other hand, the mobile phone battery reads 3.8V.

Can this voltage difference be the reason the device is not turned on with the replacement battery? Is there another possible reason? It is weird especially because the info written on the original battery also says 3.7V.


texts: Appliance countdown timer using current transformer and 555 timers

texts:
I am trying to design a timer for a 220V AC appliance (a coffee grinder); my goal is to learn about analog circuit design, I know how do this easily with an Arduino or equivalent.

I am starting from a current transformer that detects when the grinder is running, and a relay that can open the grinder power supply.

This is what I am trying to achieve:

When someone starts the grinder, the circuit starts counting down from 10s
After 10s, the relay stops the grinder
3s after that, the circuit goes back to the initial state
If the user stops the grinder, the circuit must come back to its initial state (I haven't even attempted this last requirement below)

Here is the circuit I came up with, using the parts I have around:

The CT generates 5.5V across the burden resistor, at 50Hz, with a duty cycle of 5% (roughly 1ms pulses)
The power supply on the right is 5V DC
The first 555 timer is triggered by the CT, and expires after about 10s
The second timer is supposed to start after the first one goes off, and when on it will open the NC relay so that the grinder is disabled for 3s.

As you can see I have tried to get fancy with the 555 reset pins, but the circuit as shown doesn't work:

the circuit from timer 1/OUT to timer 2/RST is trying to make sure that timer 2 is disabled until timer 1 is triggered (so that the grinder can be started at all). The 10uF capacitor was an attempt to keep timer 2 enabled for a short time after timer 1 goes off, until timer 2's output goes high; unfortunately the 555 OUT sinks current and drains the capacitor right away.
the circuit from timer 2/OUT to timer 1/RST prevents the 10s to start while timer 2 is in its 3s shutdown time. OUT and RST are connected on timer 2 so that timer 2 keeps itself auto-enabled as long as its output is high.

The simulation is here on falstad.com. Any suggestion welcome :)

Edit: I do understand the 555 is obsolete and not the right part for the job; if I were to implement this, I would obviously use an IC. I am simply trying to get better at manipulating signals using simple analog components: changing a low into a high, boosting a current or a voltage, delaying...

Edit 2: The flyback diode across the relay has been omitted above.

Edit 3: Here is a better diagram, and some changes based on the answer below that at least make the circuit work in my simulator:

C7 is making sure that the T2 555 is in reset while the circuit powers up. After that, it should only ever trigger from C6 when T1's output goes low.

M2 keeps T1 in reset, as long as T2's output is high.


texts: Vhdl error 10327 - can't determine definition of operator ""&"" -- found 0 possible definitions

texts:
I'm adjusting some vhdl code an am getting the following error:

  Error (10327): VHDL error at myfile.vhd(87): can't determine
  definition of operator ""&"" -- found 0 possible definitions

The abbreviated code is:

port(
    input1: in std_logic_vector(1 to 1);
    ...)

signal   temp   : signed1x13;
-- defined elsewhere: type signed1x13   is array (1 to 1) of signed(12 downto 0);

begin
    ...
    variable slice : signed(12 downto 0);

    slice := temp(0);
    temp <= slice(11 downto 0) & input1;

As I understand it, the & operator should append a bit onto the end of the bit array slice(11 downto 0).

I've been toying with changing the data types but haven't got it working yet.

Is there something obvious I'm doing wrong?


texts: Is there any way that the Arduino board can get damaged by using a buzzer without a resistor?

texts: I want to use a standard piezo buzzer on one of the Arduino Uno's analog pins without the use of a resistor. Will connecting this be a problem for the Arduino board? Why?


texts: How can I implement Bluetooth Low Energy CRC in 24 bits?

texts:
According to the Bluetooth Core 4.0 specification, the Bluetooth Low Energy air packet has a 24-bit CRC with the following polynomial:

x^24 + x^10 + x^9 + x^6 + x^4 + x^3 + x + 1

But, when I "encode" this polynomial, I get 4 bytes:

XXXXXXX1 00000000 00000110 01011011

What am I missing?


texts: Depending on the system used in a electric car there may be a situation were more energy is being regenerated than can be safely used to charge the battery. What happens to this excess energy? Can the motor controller just briefly disconnect the motor and the battery until the rate of energy transfer subsides to a suitable level? I'd imagine the energy has to go somewhere but I'm not sure where.


texts: Where can I find a stable AC to DC switching power supply?

texts:
I've purchased multiple 3V switching power regulators form Amazon and they all have spikes in the ripple. Here's an O-scope capture:

The spikes increase frequency depending on the load. Are these spikes a fact of life or are there better products out there?

I need something basic like this:


texts: how to calculate capacitance value from esr chart?

texts:
ok so im using a TL760M33 that outputs 3.3V (500ma) and requires a 0.1uf,and 22uf tantalum capacitor. its only powering my bluetooth module which peak current is 100ma.and the module isnt always sending or receiving data. looking at the esr chart in the datasheet my esr value using 50ma should be 1.6 ohms.Which i can find a 22uf 1.6ohms esr capacitor,but no 0.1uf.so i read the sheet again and it says to use the esr chart to find the esr value and capacitance value.

How would i find another capacitance value besides 0.1uf from using the esr chart i cant seem to figure it out?or am i not understanding them correctly?
-thanks

http://www.ti.com/lit/ds/symlink/tl760m33-q1.pdf#3


texts: Difference between multiplexer and decoder

texts: What is the difference between a multiplexer and a decoder? Lets assume a 2-to-4 decoder and a 4-to-1 multiplexer, what I understand is they both select one input based on the selector's combination. Is there any scenario that a multiplexer can be replaced by a decoder and vice versa?


texts: Masking the charging voltage on 12v battery

texts:
I am not an electrical engineer hence the odd question.  I can wire and solder though.

I have a dynamo charging a 12v 110AHr starter battery.  The dynamo has a electronics that monitor the battery voltage when charging.  When the voltage reaches 14.5 the dynamo stops, not an efficient way to charge.

Would it be possible to 'mask' or 'pull down' the battery voltage on the live feed to make the dynamo run longer.   I know that one is thinking how will I know when the battery is charged?  That will be taken care of, I just need to mask the voltage for about 5min.

I hope this makes sense

thanks

Cliff


texts: Finding coefficients for a PID controller that minimize the integral of the squared error (ISE)

texts:
The problem

The problem is to find the coefficients for the P, I and D terms of a PID controller used to regulate the object that minimize the the integral of the squared error (ISE):

$$Q = \int_0^\infty \epsilon^2(t) \ dt  $$

The object being controlled is described by the transfer function:
$$ G(s) = \frac{1}{s^3 + 6s^2 + 5s} $$

My attempt

My idea was to find to find the expression for error in the s-domain, then perform an inverse Laplace transform to get the expression for the error in the time domain, then integrate the error from 0 to infinity and then find the values for the terms k_1, k_2 and k_3 that will minimize the function. I apologize for the mistakes if I've made any as my knowledge of control theory is very basic.

What I managed to do:

The transfer function of a PID controller is:

$$ K(s) = k_1 + \frac{k_2}{s} + k_3 s $$

If H(s) is the overall transfer function, W(s) is the input, let's say it's the unit step function, the expression for error in the s-domain is, if I'm correct:

$$E(s) = W(s) - H(s)W(s)$$
$$E(s) = W(s)[1 - H(s)]$$
$$E(S) = \frac{1}{s}[1 - H(s)]$$

The overall transfer function will be given by:

$$ H(s) = \frac{K(s)G(s)}{1 + K(s)G(s)} $$

After substitution and simplification:

$$ H(s) = \frac{k_3 s^2 + k_1 s + k_2}{k_3 s^2 + k_1 s + k_2 + s^4 + 6 s^3 + 5 s^2} $$

Then, substituting for the expression for error:

$$E(S) = \frac{1}{s}[1 - \frac{k_3 s^2 + k_1 s + k_2}{k_3 s^2 + k_1 s + k_2 + s^4 + 6 s^3 + 5 s^2}]$$

I used Matlab ilaplace command to calculate the inverse Laplace transform of E(s) and got:

$$ \epsilon(t) = \frac{\delta(t)}{t} - \frac{(exp[(- k_2 - t^2 k_3 - 5t^2 - 6t^3 - t^4)(t^2 + 6t + 5)]}{t} $$

I don't know if I've arrived at the correct result, what seems weird to me is that the resulting expression for epsilon(t) doesn't contain any k_1 term. But assuming this is correct, I would finish by finding the values of parameters k_2 and k_3 and k_1(?) that minimize this integral:
$$Q = \int_0^\infty \epsilon^2(t) \ dt  $$

Question

Now, I would be grateful if you could verify whether my approach and solution is correct and describe how you would find the values of the parameters that minimize this integral using Matlab i.e. what commands and how you would use them. I'm wondering if lack of closed-form solution to the integral would make finding the parameters impossible.

Or maybe, there is a simpler method of solving this problem, perhaps by avoiding computing the integral.


texts: How can you figure out what encoded signal my IR emitter should put out to register a hit on a laser tag gun?

texts:
I am using a 38kHz IR emitter, I've taken out the IR receivers on these guns and experimented to see if I am able to transmit a signal, it's working fine, however when I connect the IR sensor back in, the hit is not registered unless it's from another gun's ir transmitter. So I believe I need to send an encoded IR signal. I tried to do a sweep of 4,8,12 digit Hex values, it might be longer hex value, and plus its a pretty unreliable strategy so far, because the IR receiver goes off at some random times, and it's hard to see if the hex values was right or maybe the lower bits of the hexvalue is what mattered and things like that. Is there another way I can go about trying to figure out what encoded signal I need to transmit with my IR emitter to register a hit on this Laser Tag gun with the IR sensor.

The product I am working with, unfortunately I can't show you the internal circuitry of this device just yet, if its needed I can do so on my next visit to class. Other than that, here is also another helpful circuit for a basic IR emitter connected to a clock tuned to 38kHz

Any idea on how to find the encoded signal this gun is putting out or how to send a configuration of signals to trigger a hit on this IR sensor. I have extra IR sensors and IR emitters with the same 38KhZ operating frequency to experiment with.

Also note that when I checked how the Guns emitter looked on our own sensors, it was just one pulse at a specified pulse width. So I tried to just mimic that pulse width back into the IR sensor of the gun, but that didn't also work. So I was also wondering, if it is indeed an encoded signal, then shouldnt I see a number of peaks at a time for one shot, and not just one peak of a certain Pulse width..


texts: Are there any open / unrestricted radio frequencies that are free for any use?

texts:
The only 'free radio frequency' that I could think of are the HAM radio bands. But they really aren't free, for they are regulated by laws that require you to hold a license, restrict what purpose you can use them for, and are governed by some organization or body.

Are there any useable radio frequencies that are 'undefined'? i.e. I could use them any way for any reason without breaking any laws or be unethical.


texts:
I got a PCB schematic and layout in Eagle format from a website and I want to edit the dimensions of components. Since everything is embedded inside the PCB layout and schematic, I find it difficult to edit component dimensions.

Can anyone help me resolving this issue?


texts:
I'm attempting get a very basic PWM code to work.  However all PWM outputs seem stuck on +5V with no proper PWM output.  It works perfectly in the simulator but not on the chip.  Any ideas welcome?

    include <P18f4431.INC>

CONFIG     OSC = IRC
CONFIG     FCMEN = OFF
CONFIG     IESO = OFF
CONFIG     PWRTEN = OFF
CONFIG     BOREN = ON
CONFIG     BORV = 20
CONFIG     WDTEN = OFF
CONFIG     WDPS = 1
CONFIG     WINEN = OFF
CONFIG     PWMPIN = OFF
CONFIG     LPOL = LOW
CONFIG     HPOL = LOW
CONFIG     T1OSCMX = OFF
CONFIG     FLTAMX = RC1
CONFIG     SSPMX = RD1
CONFIG     PWM4MX = RB5
CONFIG     EXCLKMX = RC3
CONFIG     MCLRE = ON
CONFIG     CP0 = OFF
CONFIG     CP1 = OFF
CONFIG     CP2 = OFF
CONFIG     CP3 = OFF
CONFIG     CPD = OFF
CONFIG     WRT1 = OFF
CONFIG     WRT2 = OFF
CONFIG     WRT3 = OFF
CONFIG     WRTC = OFF
CONFIG     WRTB = OFF
CONFIG     WRTD = OFF
CONFIG     EBTR0 = OFF
CONFIG     EBTR1 = OFF
CONFIG     EBTR2 = OFF
CONFIG     EBTR3 = OFF
CONFIG     EBTRB = OFF
CONFIG     STVREN = OFF
CONFIG     DEBUG = OFF
CONFIG     CPB = OFF
CONFIG     WRT0 = OFF
CONFIG     LVP = OFF

;***********VARIABLE DEFINITIONS******************

Timer   res 1
Timer2  res 1

;*******************************************************************************
; Reset Vector
;*******************************************************************************

STARTUP  CODE    0x00           ; processor reset vector
  GOTO    START                   ; go to beginning of program

 ;*******************************************************************************
 ; MAIN PROGRAM
 ;******************************************************************************

 PROG1 code

START:

;; Initialise PORTB
;  CLRF  PORTB
;  CLRF LATB
;  movlw 0x00
;  movwf TRISB
;movlw 0xff
;movwf PORTB

movlw    b'10111110'
movwf    TRISC
;  bsf  PORTC, 0

movlw    b'11010000'
movwf    TRISD
bcf  PORTD, 0

 ;***********SET UP OSCILLATOR**************

bsf   OSCCON, IRCF0
bsf   OSCCON, IRCF1
bsf   OSCCON, IRCF2

call INIT_PCPWM

;***********MAIN ROUTINE **********************************

;turn on lamp to show power
bsf PORTD, 1

movlw   d'88'
movwf   PDC0L  ;'set the PWM duty cycle
movlw   d'00'
movwf   PDC0H
bcf INTCON, RBIF
bcf INTCON, RBPU

Loop:
  call Delay
  GOTO Loop                         ; loop forever

 ;*********DELAY ROUTINES**********************

Delay

movlw   d'5'
movwf   Timer
movwf   Timer2

Loop2:
  nop
Loop1:
nop
decfsz Timer, f
goto Loop1
decfsz Timer2, f
goto Loop2

return

;***********************************************
 ;***********SET UP PWM***********************

INIT_PCPWM

movlw   b'01000000' ; deadtime
movwf   DTCON

movlw   b'00000000'
movwf   PTCON0  ; Postcale 1:1, PWM time base input is Fosc/4
                ; PWM time base mode is free-running for edge-aligned operation
movlw   b'10000000'
movwf   PTCON1  ; Count up, timer on

movlw   d'99'    ;PTPERL and PTPERH are set up for a XX PWM frequency
movwf   PTPERL
movlw   d'00'
movwf   PTPERH

movlw   b'01000000' ;configure PWMCON0
movwf   PWMCON0     ; enable PWM 0 to 5, all PWM I/O pairs set to complimentary

movlw   b'00000000' ;configure PWMCON0
movwf   PWMCON1     ; Special event postscaler set to 1
                ; Special event trigger occurs when time-base is counting upward
                ; Updates from duty cycle and period buffer registers are enabled
                ; Ouput overides via OVDCON are synchronous to the PWM timebase

movlw   b'11111111' ; no output override
movwf   OVDCOND

movlw   b'00000000' ;OVDCONS is configured such that all PWM outputs are 0 on power up
movwf   OVDCONS

movlw   b'10010001' ;FAULT A and B enabled in catastrophic mode
movwf   FLTCONFIG

movlw   0x00    ;SECTCMPL and SEVTCMPH are cleared
movwf   SEVTCMPL
movlw   0x00
movwf   SEVTCMPH

bcf FLTCONFIG, FLTAEN   ; disable fault condition
bcf FLTCONFIG, FLTBEN   ; disable fault condition

bsf PTCON1, PTEN    ; enable the PWM time base

return

;***********************************************
  END


texts:
Background
Apple iPhone Face ID uses VCSEL inside its dot projector to project infrared dots into a person face. Then an infrared camera captures the pattern to be used in a structured light algorithm to detect the 3D shape of face.
I'm interested in reproducing the above procedure by an open source project.
Someone has captured the projected dots by an infrared camera here:

First question
Maybe the first hardware I need is an affordable VCSEL projector. I'm willing to purchase the VCSEL from a vendor if it is feasible. I wonder if there is any affordable VCSEL projector which is:

High-quality enough, to be used by a structured light algorithm
Affordable, ideally in the range of $100x or less
It's OK to work with visible light. I mean, being infrared is not a priority

Other questions
I wonder whether such an open source project is even feasible? Would I be able to pull it off? Does anyone have any similar experience?


texts: Controlling servo: how to determine the angle and needed pulse-width?

texts:
I'm kind of new when it comes to using servo's with an Raspberry Pi. Although I do have some experience, I'd like to understand things a bit better. Therefore I would like to share some questions with you and hope to gain some better insights in how to work with servo's.

The questions I'm currently struggling with:

1. Given the specifications of the Servo, how can I deduct the minimum and maximum values (angles) of the servo?
 2. Using the PWM Hat described below, and the python library the comes with it, how exactly do I calculate the time that the PWM pulse needs to be set to High to achieve a certain angle? For example: what would be the PWM pulse high length to send to the servo so it will be at a 90 degree position? And what would it be for an 120 degree position?

Any thoughts, remarks or comments are highly appreciated, thanks in advance!

Hardware and software specifications

The servo

The servo we have is this one, the Power HD LF-20MG

Torque (4.8V): 16.5 kg-cm
Torque (6.6V): 20 kg-cm
Speed: 0.18sec (4.8V) | 0.16sec (6.6V)
Operating voltage: 4.8 - 6.6 DC Volts
Weigt: 60g
Working frequency: 1520us (=1.52ms) at 333Hz
Max-travel: 165 degrees

The PWM controller

To control the Servo using a Raspberry Pi we use this Adafruit's PWM/SERVO HAT for precise timing. The HAT must be controlled using their Python library in which the following functions control the servo:

The PWM software controller

First, setting the frequency. Based on the servo's specifications I guess it should be 333.

pwm.setPWMFreq(333)

Secondly there's a function that actually controls the PWM pulse. This is were I'm really doubting (see the second question above).

var port = 15
var tickHigh = 0
var tickLow = 1400 #For example; range from 0-4096
pwm.setPWM(port, tickHigh, tickLow)

As stated in the docs (see this link), the values to use are calculated based on the pulse-width needed in microseconds. But I'm really struggling here: I can't seem to determine what the needed pulse-width should be for this servo (hence the to questions).
IF I was to know that, the calculation for the software becomes a lot easier:
(1 / frequency) / 4096 = time per tick
For this servo's frequency that would be: (1/333) / 4096 = 0,00000073315503
Then I could use the following formula, given the needed pulse width length needed:
pulse length needed / time per tick = tickHigh

> If you need to calculate pulse-width in microseconds, you can do that
> by first figuring out how long each cycle is. That would be 1/freq
> where freq is the PWM frequency you set above. For 1000 Hz, that would
> be 1 millisecond. Then divide by 4096 to get the time per tick, eg 1
> millisecond / 4096 = ~0.25 microseconds. If you want a pulse that is
> 10 microseconds long, divide the time by time-per-tick (10us / 0.25 us
> = 40) then turn on at tick 0 and turn off at tick 40.


texts: Motor driver powered by PSU instead of battery

texts:
I am about to use a motor driver in a project (MDDS30 by Cytron) and I was going to power it using a 12v 11.5a PSU. I discovered that the manufacturer warns against using a PSU, and that it might destroy the driver if the motor is driven via an external force, as it would generate electricity that can kill the driver if it builds up and is not able to go in to a battery of some sort. I was considering having to use a lead acid accumulator in parallel with the PSU (I don't know if this is particularly safe or possible without adding circuitry?), but that is not ideal for several reasons in this application, mainly that the system should die if one unplugs the PSU...

So my question is this: Can I simply connect some large capacitor in parallel with the PSU instead of using a battery? And if that is so, what capacity and voltage rating should I opt for? it is not very likely that the motor would be rotated by hand, but I do not like to gamble on it being the case!

Perhaps any other solution I have not considered?
We have too little time to consider a different, less particular, driver at this point.

Thanks for any input

To update the question with some more information: The drivers operating range is 7-35V, my system is purely 12V, and other components includes a PLC. If a higher voltage than 12v is fed back into the system from the motors (like commenter glen_geek mentions) it might cause the PLC to become unstable.


texts: Automatic switches for a 12 V LED with two separate power sources

texts:
I am converting a Mercedes Benz Sprinter van into an RV. I have a 12 V LED dome light (actually several) that activate when a door is opened, powered by the vehicle's power system (battery/alternator) I would like to tie that same light into the 12 V house system, without the two systems back feeding each other.
What is the best way to accomplish this?Would oneof these work?


texts: Do I understand how this Digital Integrator circuit is supposed to work?

texts:
So I need to build a circuit that operates according to this block diagram and explanation: http://puu.sh/rTqfu/0e56b48637.png

This is how I think the circuit should work:

Put an input signal into an ADC, check the MSB to see whether the input is positive or negative, and count up if it is positive, and down if it is negative.
The 8-bit count gets added into a register, with whatever is in the register.
The register is outputted into an 8-bit DAC, and the output should be the integral of the input.

Am I anywhere close on this? I'm not sure I fully understand how the circuit should work. I made a design for the circuit in multisim, but my output doesn't look quite right.

Here is the circuit I designed: http://puu.sh/rTr2k/3535af3290.png

And output: whttp://puu.sh/rTr43/723355f566.jpg

My circuit uses an adder to determine wether the input is + or -, and that gets fed into my cascaded 8-bit Up/Down counters. That count gets inputted into a cascaded 8-bit adder, and the feedback from the 8bit register is added with the count. The output is fed into a DAC and shown on an ocsilloscope.

If you could explain to me how this is supposed to work practically, if I'm WAY off, that would be amazing.


texts: Drawbacks of using single-ended communication over differential pairs

texts:
I recently bought a ZYBO FPGA board only to find out that there are exactly six regular single-ended GPIO lines wired to the FPGA. In contrast to that, 18 differential lines are available. The board's reference manual says that single-ended communication over the differential lines will work, but has "significant crosstalk". Grounding one line of the differential pair is suggested in this case, but this will obviously negate the whole purpose of having more single-ended IO lines.

So, what exactly is "significant" crosstalk? How fast would I be able to communicate (single-ended)? Would high-speed I2C work well? 2mbit SPI? What about a 25 MHz parallel data transfer? Can anything else be done to avoid or correct for crosstalk?


texts:
In the Image... I am trying to put 30A 12V Relay OMRON G8P-1A4P 12VDC parallel to Push Start Button (Dual Starter control for 1HP Pump Motor). But every time relay picks up contact stick...  Before using  the Relay I was using 25A 24-480VAC SSR (Zero Crossing) but 4-5 of them failed due to large Surge / Inrush current. So I switched to  mechanical       Relay. But now the     relay contacts are sticking.Do I have a weld current issue?

I also tried to add RC Snubber 0.1uF 600V + 66 Ohms but did'nt help.

Please suggest some idea of   how I can  avoid Arcing. Relay contacts are rated for 30A / 250VAC my load is max 20A for just 0.5-1 Second. Then contactor picks up and motor is operated through Contactor. No load is given to relay later on.Could I have underestimated the surge current?


texts:
I am supposed to use an light having the following specs. as described in the below statement.

"A red light, equivalent in its luminescence to a 21 W light bulb is to be used."

On an average how much light does an 21 W light bulb emit (in luminescence)??

I am planning to go with a array of high power LED's as it is more energy efficient.

If its LED what should be the power rating of led to give enough luminescence as described in the above statement.

If not LED is there an better option provided it is economical and energy efficient.


texts: Multimeter capacitance value - ADC readings

texts:
I have set up my raspberry pi to read from the MAX1204. To know if I'm reading the proper value, I use a multimeter at the input channel of the ADC, and compare it to what I read through my program. This works great. However, when I disconnect my multimeter, I don't read the same value. If I was reading 1.264 - 1.268 (correct measurement), I now read 1.248- 1.252.

I assume it's due to the internal capacitance of the multimeter, or some other reason. How can I set up a capactiance or a way to read the correct readings without constantly needing to have the multimeter plugged in? I tried using a 0.01uF, 0.1uF and no luck.

Block Diagram (to try and replicate schematic):

Edit: it would seem that when changing my multimeter to the 2V option va the 20V, thé close it 1.276 but the ADC is still reading 1.25. Which means I have a 25 mV difference between voltage and readings.


texts: PCB Pad sizes: Is it worth going over Level A of IPC-2221?

texts:
All is in the title. I've been using this "guide" to calculate PTH pad diameters.
I'd like to comply at least with Level A of IPC-2221. Apparently it just means that the pad has to be 0.7 mm (275 mils) larger than the hole size.

However, some of the built-in Kicad footprints (in my case Connectors_Molex:Molex_MiniFit-JR-5556-24A_2x12x4.20mm_Straight, aka 24 pin ATX motherboard header), have a pad size about 1.5mm (600 mils) larger than the hole size.

So again, my question is: Is it worth going over the 0.7mm spec? (does it really make it easier to solder the pins?) In my opinion, it's more negative than positive. What do you think?


texts: Is there a minimum voltage necessary for solenoid?

texts:
For electromagnets, is there a minimum voltage >1V required or necessary to function properly?
Example, 100mm long iron wrapped with insulated copper.
EDIT: Thanx and my apologies for not being specific enough. TO REPHRASE:
I know l will have 1 Volt to work with and have several amps. Is this enough voltage for an electromagnet 100mm long?
Neil, thanks for the note on temperatures. Also, and I can't read who it was at the moment, thanks for the note on geometry and where can I find such a discussion.


texts: Have a surface mount device 6G80 package SOT23-6 not able to find datasheet/ or even basic information

texts:
I have a cheap power supply that I am trying to modify. The 6G80 appears to be a regulator (driver) chip that drives an N-MOSFET. I do not have an oscilloscope with me, so I am unable to tell if it is running linearly or chopped. One side of the output winding of the SMPS goes to the storage capacitor positive.  The other side of the winding goes through an N-MOSFET (D) with the (S) connected to the negative side of the storage capacitor. The gate is connected to the unknown chip. The output is a fixed 5.0 V at about 3 A, which is relatively stable over the load range.

I would like to increase the output voltage to 5.2 V, but would feel better understanding how the unknown chip is working, before I modify the circuit. If anyone has a datasheet for this chip, I would greatly appreciate it.

My gut tells me that I need to lower the voltage by 0.2 V going into pin 6 of the chip (voltage divider?) The rough diagram is attached for clarity.

NOTE: pin 1 is bottom left and follows IC conventions.


texts:
I am working on hacking an RC remote controller I own. What I intend to do is open it up, and tap into the potentiometers. I want to read the analog values delivered by the potentiometers, and send the signals to my PC. Essentially, I want to re-purpose it to work like a joystick with the HID USB interface. Of course, the HID interface is not necessary, but I believe it is the best way to go about this.

I am quite familiar with the AVR microcontroller family, so I initially though I could try something like V-USB with an ATMega8. At the same time, I began to think that it may become unnecessarily difficult. Is there any easier way to achieve such connectivity without breaking the bank?


texts:
I have a device that is powered by the Arduino (+5V).

The device (a VC0706 Powered camera), incomporates a MAX3232 to convert to RS-232.

Unfortunatly, I don't have the tools or dexterity to remove the TTL/RS232 conversion manually.

My question is: is it possible to establish communication between the device and the Arduino with RS232 interface?


texts:
I'm pretty new to electronics and I'm having trouble understanding what's happening in this schematic:

I can see the inductor is going straight from the + to the SMA, however I'm not sure how to implement the capacitors, I can't see how he's routing them on the photo. How do I need to wire C15 and C16 if I want to supply the IC and oscillator with DC only?


texts:
Good day to you all.

I just accidentally stripped off the thin lining of metal that is found on the eDP cable of a Lenovo laptop (Lenovo IdeaPad 320-14IAP). The thing happened when I removed it from its socket, then I noticed that I had its conductors still held by the socket.

It has 31 conductor strips in total, with 1 totally removed, and with 2 had its orange covering removed.

Now the miracle goes, I still had my laptop monitor up and running! Without any issues, of course, since I tested and played games on it.

For my question, should I still continue opening my laptop, or leave it forever like that? I'm getting worried about removing it then my laptop monitor would fail.

EDIT: I am opening my laptop because I'm adding oil to its hinges (its getting stiff), but its a separate problem. Removing and adding oil to hinges requires the removal of the eDP cable.

EDIT2: The eDP Cable model is DG421. Additionally, this is the female socket of the eDP cable.


texts:
I accidentally stuck my oscope probe into my ESD mat ontop of my work bench. I happened to look at my oscope. Surprise! There's a 20Vpp 60Hz voltage on the mat! (see picture) (note, the ground clip of the probe is not connected to anything)

The ESD mat is not currently grounded (before anyone jumps on me, I had it disconnected to move it, and haven't put it back yet because I haven't been dealing with anything that is ESD sensitive.) When I connect the mat directly to earth the voltage flat lines and all is well. When I connect the ESD wrist strap to the mat and then to earth, the voltage reduces to about 3 or 4Vpp. The wooden bench top itself measures nothing at all. There is a power strip screwed into the top of the bench, but its casing is ground to ?earth.

My question is how is that 20Vpp on the mat itself? If it isn't actually there, what am I witnessing? Should I directly earth my mat or is that dangerous? I have stopped working on the bench until I figure out what is going on.

NOTE:I will be happy to edit this question, or delete it if it is off topic or doesnt make sense. But I'm not even sure how to ask this question properly.


texts: Why can't I short circuit a virtual ground with ground in OP Amps?

texts:
Consider this circuit for instance.

simulate this circuit – Schematic created using CircuitLab

If I calculate the closed loop gain of this circuit using Kirchhoff's law it turns out to be

$${V_o\over V_i} = {-R_2 \over R_1}\left( \frac{R_4}{R_3} + \frac{R_4}{R_2} + 1 \right)$$

Since one end of \$R_3\$ is at 0 potential and \$V_1\$ is also at zero potential, \$R_2\$ and \$R_3\$ can be considered to be connected in parallel connection, which is then in series with \$R_4\$. This way the closed loop gain turns out to be

$${V_o\over V_i} = {-1 \over R_1}\left( \frac{R_2 R_3}{R_2 + R_3} + R_4 \right)$$

This value isn't equal to the above calculated value, hence there must be something wrong with this method. The only mistake I can think is short circuiting \$R_3\$'s one terminal with \$V_1\$ junction. But why can't I do that?


texts: Controlling AVR reset via voltage divider

texts:
I have an AVR atmega32u4 which is being run on 3.3v. I program it using a avr usbisp, which runs at 5v.. The problem i'm having is driving the reset pin.. I currently have this schematic where PROG_RESET is the 5V/GND reset pin on the programmer, and AVR_RESET goes to the AVR IC's reset pin...
What I am seeing is: programming works brilliantly, but the chip never boots, as AVR_RESET is constantly held at ~100mV - low enough for the IC to stay in reset. Even when only connecting power. Briding the 10K resistor doesn't seem to boot it either.. What values of resistors should I change to, to make the reset divider functional?


texts: How exactly does a GFCI use induction to prevent electric shock?

texts:
I have read that electromagnetic induction is the physical basis of a GFCI (Ground Fault Circuit Interrupter), and was wondering how exactly the GFCI uses induction to break the circuit and prevent harm?

Thank you for your help!


texts: So, there is a function in the Adafruit SSD1306 Library that prints a scrolling text. For examples, display.startscrollright(0x00,0x0F); will print a text scrolling towards the right. What are the arguments "0x00" and "0x0F for and what kind of arguments are they?


texts:
I have built an H-bridge with the following schematic.

My motor controls a wheel that I want to turn backwards and forwards. The voltages to the bases of the BJTs   are supplied by an Arduino. the Motor has a 3V battery supply.I am worried that a supply voltage above 1.4 could cause cross conduction.

Everything is working fine except for one thing. When I press one of the switches (either to make the wheel turn forwards or backwards) it is as if current starts "leaking" and from that moment on the wheel always turns slowly forwards. If I hold it in position for some time it stops spinning but if I turn the wheel by hand, or touch one of the switches, it starts turning again.

If I press the switch to make the wheel/motor go forward, it only turns faster, and if I press the other switch it turns backwards (but suspiciously slowly!).

Does anyone have an idea what could cause this problem? Is it "normal" for transistors to leak current in this way when I'm working with such a low voltage supply?Is the circuit gallery circuit flawed?

Thanks in advance!


texts:
I am trying to troubleshoot communication between Arduino (master) and 3 slave sensors (VL53L0X):

Below is VL53L0X sensor module I am using. I checked and confirmed that the placement of resistors and capacitors are as recommended by each components' datasheet. XSHUT is a pin on VL53L0X that shuts the sensor down when it is low (active low). When the sensor first boots up, its I2C address is set to its default value, so XSHUT is used to change this address by booting VL53L0X one by one and modifying the address of only one sensor at a time.

Below is schematic of the circuit on the breadboard. I am using 4K7 pullup resistors for I2C. (Sorry I am still learning and I used PowerPoint because schematics software is still difficult for me)

I can reliably communicate with only 1 sensor attached. It worked with 2 sensors attached today (but I was not able to do so yesterday). I ultimately want to connect 3 sensors. When I connect the third sensor as shown above, it stops working and I cannot communicate with any sensor.

Below is oscilloscope measurement with only 2 sensors attached and the 3rd sensor completely disconnected (this worked today). Channel 3 is XSHUT and channel 4 is 5V.

Zoomed in:

Below is oscilloscope measurement with the 3rd sensor attached with its XSHUT pin connected to ground and SCL/SDA/5V connected as shown in breadboard schematic above:

Zoomed in:

It looks like it is working for a while and then suddenly fails in the middle. Once it fails, I have to reset the microcontroller. The point at which it fails varies every time. None of the sensors are broken because they work when connected individually. 5V and XSHUT line look stable. I tried increasing and decreasing the resistance of the pull-ups but did not really help. The oscilloscope also seems to affect the communication (seems to work better when probing) so something about my setup is very fragile (susceptible to small external influence). Could someone point me to where I should look? Thank you.


texts: Digital vs Analog signal for data transfer across boards

texts:
I have 1 board that reads data from a sensor, while another board wants to get data from that sensor.

Is it better to have an ADC on the first board, then send that data via i2c to the 2nd board? Or is it better to send the analog signal from the first board directly to the ADC of the 2nd board?

My assumption is that sending the analog data across 2 boards is going to have a lot of noise.


texts: Enabling and disabling serial device connected to the Arduino HardwareSerial by software

texts:
I want to use the hardware serial port (pin 0 RX and 1 TX) to connect a MAX485 IC. Internally these pins are also connected to the onboard USB to serial converter microcontroller which is used to flash the ATMega328 using the bootstrap code.

I know I can't have two different serial devices (USB and MAX485 in that case) at the same time without interfering each other. Given that I want to use the HardwareSerial and not a solution based on SoftwareSerial I have added two jumpers on my design that let me connect and disconnect the MAX485 to the RX pin 0 and TX pin 1 if I want to upload a new sketch.

I have two questions:

Is there an elegant way to reduce the two jumpers TX and RX to just one that when shorted connects or desconects both pins at the same time (max RX and TX to pin 0 and 1 on the Arduino)
Is it possible to use a transistor software controlled by an arduino pin to have the same efect and let me choose when I want the max485 connected and when I want to fallback to the arduino USB to ttl?

The idea is that if the device is reseted by the computer to upload a new sketch the USB device will be active, once the device has booted as part of the boot process will enable the MAX device and the built in USB will be disabled as the MAX IC will have preference.


texts: Connect Marsboard with Touch Panel and access GPIO pins

texts:
I am thinking about using a MarsBoard A10 and LCD Touch Panel for low volume commercial product but I have to confirm some capabilities first.

Firstly, what would it entail to get the Marsboard A10 http://www.marsboard.com/ set up to display to and receive touch input from a http://www.hotmcu.com/43-inch-480x272-tft-lcd-display-touch-panel-standard-40-pin-p-43.html?cPath=6_16. It appears as if though their "A20 Linux" http://www.marsboard.com/download.html (which I am not sure will run on the A10) supports the display and if the Marsboard does have all the pins correlating to those on the display but I need confirmation as to exactly what would be required to form a connection. For example what physical connector will I have to use and will any extra software or hardware drivers be required?

I would then also like to know how many digital IO, PWM and analog input pins I will have available on the Marsboard after I have connected the screen (I am struggling to find any reference as to what is available with or without the screen) as well as how I will be able to control them from a program running in the Linux OS on the Marsboard?

PS. I want the entire operating system to interface with the display panel and not only just an application running inside the operating system.


texts: Losses and/or inefficiencies using a DC/DC voltage regulator?

texts:
I have a Li-Ion power pack that has either bad 18650 batteries and/or bad charging circuitry. I have 18650s, and I can get a different board on ebay. What I need to do is step down the voltage from the batteries, which are all in series, to 5V USB input.

I can either leave the 18650s in their current arrangement and step down the voltage from 55V to 5V, or I can rearrange the batteries such that I have seven pairs of about 8V in parallel, and step that down to 5V.

Is it more efficient to step 55V down to 5V or 8V down to 5V? I need to get the most power out of the batteries possible. I have room inside the pack for a Raspberry Pi (which is the purpose), but not much else.

If it's better to go 8V to 5V, I might be able to sacrifice some of the pairs for more room in the pack, if the charging circuit won't notice some missing batteries.


texts: How to place normally closed switch in Visio

texts: Today I was making a simple diagram in Visio Pro, when I needed to use a normally closed switch. Is there a way to place it? I haven't been able to find it!


texts:
From this link the balanced gain and input impedance differential amplifier has such resistors:

simulate this circuit – Schematic created using CircuitLab

$$ R_1 = \dfrac{R_i}{R_i+R_f}R_i$$
$$ R_2 = \dfrac{R_i}{R_i+R_f}R_f$$

From above equations we could observe that input impedance seen from \$V_1\$ shall be \$R_i\$ and impedance seen from \$V_2\$ is \$(R_1+R_2)\$.

Q1: What is the benefit of using such resistances instead of adding a parallel resistance to \$V_2\$?

simulate this circuit

Q2: Why in the 3 op amp instrumentation amplifier this kind of balancing is not performed?


texts: When current flows why diode not makes any shortage in it

texts:
I konw that a diode works like the explained here.

How does a diode work?

but I have different question as I am not expert in Electronics,
well i am showing you a very simple circuit which is below.

if you see this (i am sorry i am not expert) there are 2 wires going out from the source of power 1 is going to diode and 2nd is going to capacitor,
normally when we touch plus and minus there will be some shortage but in this circuit (at red circle) I can guess that it should be short circuit but i know i am wrong.
so what is the logic here please tell me.

Thank you


texts: CANBUS multi-node communication fails when electing bus master

texts:
I'm managing a legacy system (created by my predecessors) which uses CANBUS. In the system there are multiple nodes, which are run by the MC9S08DZ60 microcontroller each. There are of course separate isolator and transceiver. Every node is configured to have a piece of unique hardware information, lets call it CANMAC.
The way the system is designed is that when the system makes a "cold start", nodes try to agree on themselves who is the bus master. They send with the same CANID (001) to the bus their CANMAC and listen on the bus. The node with highest CANMAC gets elected to bus master.
When there are small amount of nodes, everything is kind of ok. At least the election stops and bus master starts its job.
But with larger number of nodes the elections keep on going for ever. Because some nodes have not seen some other nodes and their higher CANMACs.
This is what I get into logs (I have obfuscated it a bit):
14531ms 001: "Valid election candidate message with CANMAC, 7 bytes payload"
14532ms 001: "Valid election candidate message with CANMAC, 7 bytes payload"
14532ms 000: ???                       00 08 00 00
14532ms 000: ???                       00 08 00 00
14533ms 000: ???                       00 08 00 00
14533ms 000: ???                       00 08 00 00
14533ms 000: ???                       00 08 00 00
14534ms 000: ???                       00 08 00 00
14534ms 000: ???                       00 08 00 00
14534ms 000: ???                       00 08 00 00
14534ms 000: ???                       00 08 00 00
14535ms 000: ???                       00 08 00 00
14535ms 000: ???                       00 08 00 00
14535ms 000: ???                       00 08 00 00
14536ms 000: ???                       00 08 00 00
14536ms 000: ???                       00 08 00 00
14536ms 000: ???                       00 08 00 00
14537ms 000: ???                       00 08 00 00
14537ms 001: "Valid election candidate message with CANMAC, 7 bytes payload"
14538ms 001: "Valid election candidate message with CANMAC, 7 bytes payload"

Now what I ask is:
Is it possible that these messages senders, while sending with the same CANID 001 almost at the same time, are able to circumvent the CANBUS natural collision avoidance/arbitration by broadcasting concurrently and essentially overrun bits on the bus causing unknown messages to form to observer?


texts: What is the use of the line connecting drain and gate in current mirror using voltage bias?

texts:
I am confused about current mirror. Given this circuit

simulate this circuit – Schematic created using CircuitLab

it makes sense to connect the drain to the gate in order to make their voltage the same to bias according to the equation

$$I_{DS} = \frac{\beta}{2}(V_{GS}-V_{TH})^2$$

then

$$V_{GS} = V_1 - V_{R_1} = V_1 - R_1I_{DS}$$

So having the line connecting drain and gate is necessary to define \$V_{GS}\$ and \$I_{DS}\$

However in this this circuit, I can't understand what is the point having that line connecting drain and gate. For MOSFET, there is no current flow to gate and be so \$I_{DS} = I_1\$. By that I can already calculate \$V_{GS}\$ and \$M_2\$ have the same \$V_{GS}\$ as \$M_1\$ that make it a current source. So, what is the point of having that line here?

simulate this circuit

From what I understand, the point of current mirror is to make the \$V_{GS}\$ unchanged and apply voltage to \$M_2\$ large enough to make it in saturated region that make it behave nearly like a current source. So in this circuit, \$V_{GS}\$ is archived by the current source \$I_1\$ already, then why there must be a line connecting drain and source together?


texts: Use Chinese LiPo battery charger units in series (Create a 2s charger)

texts:
I have received two LiPo charging modules on eBay with under-voltage and overcharge protection built in.

I would like to achieve a voltage of 7.4V, by connecting the outputs of the two modules in series. I am aware of the many dangers of LiPo batteries and so I am trying to take precaution and make sure that I haven't missed anything.

As far as I can see it will be safe to wire up each of the charging modules with a battery (I am using batteries of the same capacity for each module)

I can then wire up the outputs of the modules in series to achieve the 7.4V output. I can use a single 5V rail to power both modules to allow for simultaneous charging of both batteries. When either of the batteries dies, the circuit will break and thus the over discharge will work normally.

Have I got anything wrong here?
Is there anything that I should be
cautious about when using the modules in series instead of the
normal, single battery with a single cell?


texts: Multiple Resonances along a transmission line

texts:
in "Lessons in Electric Circuits", VOL III, ChPT 14, all the possible configurations of standing wave for a certain transmission line are shown. For instance, this is the case of a transmission line left open at the ends:

According to the operating frequency and the transmission line characteristics, there may be:

My question is: do these different configurations of standing waves exist simultaneusly (i.e. the total voltage and current waveforms are their superposition) or does each of them exclude each other?
From the author's analysis, it looks like there is only one of these configurations, at a certain frequency. But I've seen many similar situations in which there is a superposition of standing waves. For instance, I'm thinking at the analogy with a rectangular waveguide:

In this situation there are not V and I, but only E and H fields, but the situation is similar: the metallic surfaces of the shell's lateral wall set the condition $$E = 0$$ (as well as I = 0 or V = 0 are set respectively by the open circuit or the short circuit at the end of a transmission line), which may determine the standing waves shown in figure.
For this structure, I've always been told that all these modes exist simultaneously: when a source is put inside the waveguide, it excites all propagation modes, some of which are above cut-off (and will propagate) and some other which are below cut-off (and will be attenuated). So, according to the operating frequence, multiple standing waves may exist.
Is there a similar situation, with cut-off standing waves frequencies, for transmission lines?


texts:
I am trying to repair a remote from a car lock. The symptoms are that a red led is lit longer than usual after button press and no respond from car lock. It works sometimes. The battery and microswitches are replaced. All elements are resoldered. On the other side of the board is a tantalum capacitor. I measured it and is ok. (1uF 106)

What is this element on the right? It has 1Ω resistance

EDIT:
I desoldered the similar looking element which on the picture is still soldered. It says 560J and is totally short: 0Ω.

On the other side of the board is a capacitor similar looking but with a bar on the positive pole. The capacitor has 106 marking and is working.


texts: What is the maximum recommended routing distance between MAC and PHY?

texts:
Picture to Keep the Terminology Clear:

I plan to use ETH for inter-processor communication. I need a few ETH lanes to be shared between boards. I wish to avoid ETH PHY and magnetics, as the interface is between two processors only.
I have a few RGMII outputs coming from a TI-TDA2x, which needs to be taken to a back-plane. From the back plane, I shall take it to another board having TI-TDA2x.
I want to know what is the maximum safe distance between MAC to PHY which can be maintained?
TI-TDA2X: Datasheet
My Speed Requirement: 1 Gbps


texts: Testing graphic LCD without code and wiring

texts: I am using a KS0108 compatible graphic LCD (JHD12864E). I was wondering if there is a method to see if the lcd is working or not with a simple test. I tried sticking 5 volt between vcc and ground but nothing lights up. Is there a way I can test this module without messing around with the wires on the breadboard?


texts: What are good beginner circuit simulator programs?

texts:
I am a software engineer and, as a hobby, I have been trying to learn more about building electronic circuits and making use of microcontrollers for making items such as robots.

I know the basics of circuit design, but I would like to do more experimentation on the computer before physically building my circuits. I've glanced around at some circuit simulator programs, but they seem complicated to me. What are some good beginner programs that will allow me to design and test circuits?

Thanks!


texts:
I just need to create a logical circuit. i have input and output signals.
Here is steps which i need to have done

Simplify boolean expression using karnaugh map
Generate logical circuit using expression from step 1 and different basis
Generate time diagramm of working my circuit

Is there any software which could help me?


texts: Limiting the current without limiting the voltage

texts:
I want to design a current limiter, for both negative and positive voltages, for my thesis project.
My design consists of a voltage source (+/-10V)(X5) and a transimpedance amplifier(X1.)
Using the already existing circuit, in particular using the transimpedance's output, I though that I could use feedback to implement a current limiter.

As you can see in the circuit, the transimpedance amplifier's (X1) output is firstly inverted (or buffered depending on the current flowing direction) and then feeds two comparators (X3, X4) which drive the MOSFETs, comparing the inverted (buffered) transimpedance amplifier's output with a reference voltage.

As you can see in the plot, the load's current(red line) is limited as expected at 5 nA (that's because 2.5V across the 500MOhm generates a 5nA current, which is converted in 5V by the transimpedance amplifier.)
As you can see though, the output voltage (green line) is also limited to 2.5V even if the input voltage (blue line) rises to 10V.
I don't expect this since there is an opamp that should maintain the voltage equal to the input due to feedback. I really need that the voltage rises even if the current is limited.
Can you help me understand why this happens? Is this current limiting circuit pooly designed? If yes, can you suggest to me how can I improve it?
EDIT: I know about Ohm's law. But what I want to design is aimed to recreate a usual experiment that scientist do in papers about memristors. They limit the current to prevent the memristor damage, but they increase the electric field, i.e the voltage, on the device.

That's is what I would like to design and that's why I'm trying to force Ohm's law.


texts: Is it possible to determine a low power isolation transformer maximum output current?

texts:
I have a transformer (no codes) 240vac to 12vac this is easy enough to determine but what about the maximum current?

1) I could load it until the voltage drops but to what exactly?

2) Is there any way to determine this from measuring the inductance and series resistance or any other measurement?


texts: How does a diode-connected MOS device 'clamp' the voltage

texts:
Hi,
I'm having some trouble understanding how the diode-connected device M3 maintains a fixed voltage difference between VDD (source) and node X (drain)? In other words, why is it called a diode?
I know that diode-connected devices are always in saturation if they are turned on. But who says that their Vgs will be equal exactly to their Vth. Can't Vgs be greater than Vth for a diode connected deivce?, so then the Vdd to Vx difference will no longer be a constant Vth.


texts: Why does ammeter or voltmeter measures RMS value

texts: When there's an alternative voltage, why does the voltmeter measures rms value instead of the value at that specific time?


texts:
What I have:

A transformer rated at 150VA / 30V (center tapped) / 5A
Speaker rated at 30W / 8 ohms (measured 6.3 ohms with my multimeter)

Will use class AB amplifier:

LM4780 http://www.ti.com/lit/ds/symlink/lm4780.pdf

Question:

If I send +30V & -30V to this chip, I will get 45W at 1%THD+N:

Is it possible to keep +30V & -30V but limit the maximum power to 30W? Is it by playing with the gain (feedback resistor value)?

I read somewhere "...power amps at lower gains requires more input voltage to get the same power output, with the same speaker impedance".

How to adjust/calculate the gain so that I get a maximum of 30W output with +30V / -30V power supply?

Any advice would be much appreciated.


texts: how can we read the exact potentiometer value?

texts:
Can you please How can we check if we have the correct value from a potentiometer in a circuit?
thanks for your help


texts: Why does having a ground in middle of center tapped transform cause it to split voltage?

texts: At a round 2:52 of this video https://youtu.be/74QrYyYsftY?t=169, the narrator states that connecting a wire through the center of the transformer splits the voltages between two halfs of the transformer. Why exactly does this happen?


texts: Opto-isolation amplifier output is too off

texts:
(As a follow-up to an earlier question answered by the community - thanks!) So I've got the test circuit setup using the HCPL 7520 (datasheet) now and planning to use an Arduino Uno to measure the voltage at the VOUT.
I've done some tests now though and the VOUT seems to be too off. Below, I've got vRef voltage-divided to 4.41V and the VIN+ to 154mV. The rough VOUT I was expecting was VIN * GAIN = .154 * (4.41/.512) = 1.32V. But I read 3.05V at VOUT and, once adjusted (by -vRef/2 by looking at Fig.5 in the datasheet), I get 0.845 which is completely off.
(Pls ignore pin numbers in the diagram)

Another attempt was VIN+ = 104mV, expected = 0.89V. But I read 2.73V at VOUT, which adjusted becomes 0.525V. Again, not right.
I'm clearly doing something wrong - could anyone correct me or point me to the right direction?
Thanks!


texts: Repairing my FFC connector - what to use?

texts:
I'm using a Pi Camera v2.1 and a 15-pin FFC

My 150mm, 15-pin Flat Flax Connector (on 1 side) has 1 pin slightly shortened (metal torn). My Raspberry Pi 3 is not working with it. What should I do:

Try to do a software fix
Get a £2 new flex cable
Fix the cable (How?)


texts: Connecting a PhilipsHue led output to a relay

texts:
I followed an Instructables tutorial to get some understanding of what pins can be used from the Hue light bulb.

Out of all the "exposed" pins, I focused on

TP1 - Ground
TP6 - LED output

(basically the top-left connector pins)

So my end-game is to have a relay controlled by the Hue app and turn on/off a 220VAC circuit (low power consumption, so a 10A/250V solid state relay like the one mentioned in the tutorial is just fine: Fotek SSR-40 DA-H)

But when measuring TP6, i found that it outputs 9VDC when the LEDs are off and a maximum of 57.7VDC when the LEDs are at 100%.

This is probably because i'm using newer bulbs than the ones used in the tutorial (i also didn't have the big black rubbery insulation on the circuit board)

I figured that the next steps would be

offset the output voltage so instead of 9-57.7 i would get 0-48.8 (by using an OpAmp)
use a voltage divider to get a 0-12 VDC output (so like a 1/4 divider)

Is this the right way to go? If yes, can you recommend an OpAmp that would do the job and some resistor characteristics i should consider (i'm mainly concerned about heating)?


texts: I've come across a design where each pad was connected using 4 'bridges' to the GND copper layar. What stands behind these 'bridges'? Why not make a full copper layer with only solder-mask defining the pads?