texts: Controlling Speed of a Single Phase 120v AC Motor

texts:
I have a drill press from the 1930s.  The motor has no markings and is likely from the 50s or later.  Right now, it is single phase 120v on/off.  I was wondering if it were possible to control the motor's speed using a micro-controller.  From what I am reading, the answer is no.

Please correct me if I am wrong, but PWM will not work, nor will varying the voltage. As well, there are potentially dangerous current issues if the frequency of the ac voltage is made too low.

Am I missing any possible solutions?

Thanks in advance.


texts: Electrical induction at a distance through coils for an LED night light

texts:
I have 3 decorative candle based night lights, and as an enthusiast project I decided to use LEDs instead of candles to modernize them and make them cooler.

I don't want to use batteries, and I want to be able to just connect them to a wall socket. Then it hit me that it would be way cooler to just place these lights somewhere, and have them emit light wirelessly if that's at all possible.

My reasoning was that LEDs generally require very little power and having these lights emit just a little light would be acceptable. Now I am not an expert at this, but I thought it was possible to implement.

So I want to have 3 coils connected to 3 LEDs in these lights, and have a single, bigger coil "base" powered through a wall socket underneath or behind these three. As the source is AC it should continually induce a current in the 3 light coils and keep the LEDs on.

So here are the parameters:

Source is 220V/50Hz
Max distance of each light from the source is 30cm
Everything else is variable. I am open to suggestions on what kind of LED or other light source to use, what kind of coil to use, etc.

And questions:

Is this practical at all?
How big should the coils be for each light, and the "base" coil?
Is it better to work with the 220v source, or use a transformer to bring down the source voltage and then have it flow through a coil? (Sounds a bit silly, I know)
What type of LED would be suitable for a current that can be induced at this distance?
Should I worry about other electrical devices close to the "source"? How do I protect them from the electromagnetic field?

Open to all ideas, thanks.


texts:
According to SD card datasheets, there is an internal pull-up resistor on the DAT3 line, and we can use this line to detect the card. Additionally, the ACMD42 command is described that it is used to disable this pull-up resistor. However, when I look for some SD device driver code I see that they do not send this command.

Is sending the ACMD42 command a must or a recommendation? What happens if we don't send this command?


texts: LCD Zebra display, repair bonding (ITO Trace?)

texts:
Is there a way to repair the "traces" displayed below?
I don't have any idea about the subject, but maybe painting them with a conductive paint? I could create a template with the traces, and then drag paint over them
Thank you


texts:
I'm currently designing a 7400 series circuit to drive LEDs from a set of shift registers (74595).  Each shift register's tri-state input is wired to the output of a 2:4 decoder (74139), and the decoder's input is driven by a 4 bit counter (74191).  The counter has a 200Hz clock input.

In steady state, this circuit runs fine.  My concern is during the transition. According to the 74LS139 and 74HC595 datasheets, the decoder will transition from one output state to another faster than the tri-state output of the shift registers.  This means that there is a brief period of time (about 10ns) where both shift registers will drive their outputs before they complete their transition.

My question is, will this brief transitional period damage and eventually destroy the shift registers?  I've attached a simplified schematic illustrating my question.

Do note that this is a simplified schematic.  The real circuit has way more shift registers.  As such, multiplexing each shift register is prohibitive (I would need a 96:32 multiplexer, a.k.a. lots and lots of 7400 series parts).


texts: The Best Place for the Reverse Polarity Protection Diode

texts:
I have several RS485 devices. All of them are connected together and power by a 12V power supply. Each device has its own 5V voltage regulator. I want to use diodes for each of them to protect aginst power supply reverse polarity connection. The problem is if I place the diode on the 12V input terminal, about 125mA will flow through GND (that is wrongly connected to 12V) and A or B (that is connected to other devices and has +-5V); And if I put the diode on GND, the GND level of the devices will not be equal because of the voltage drop across the diode.

simulate this circuit – Schematic created using CircuitLab
So which is the best option?

One diode on the 12V input terminal for each device.
One diode on the GND input terminal for each device.
One diode on the 12V and another diode on the GND input terminal for each device.
Another solution.


texts: We have 470pF 500VDC caps (Kemet part number C1206C471KCGAC Ceramic, SMD, MLCC, Ultra-Stable, Low Loss, Class I, 470 pF, +/-10% Tol, 500V, C0G, -55/+125C, 1206, 0.1% DF, Dielectric Strength=750V) on 110VAC 400Hz signal and chassis ground (I think for EMI purposes after main design was completed) in our Controller circuit. This should be okay. Is it or can it cause problem since these caps are DC rated? What would happened if they mistakenly placed 100VDC rated caps with the same spec in place of 500VDC caps?


texts: Build a T flip-flop with enable and reset using only a JK flip-flop (without enable or reset) and some necessary logic gates!

texts:
So I was told to make such circuit asked above, I am thinking that if Enable is low then Q(t+1) will be just Q(t) (like 'keep') while if enable is high then check Reset, if reset is high then Q(t+1) always becomes 0 but when it is low then check T, if T is high then do toggle otherwise do keep. And the JK flip flop uses the excitation table (the one that uses don't cares).

I have built the truth table and the K-map unfortunately when I see the K map I cannot see any Q so it is not going to loop back is that okay?


texts: How does one choose a resistance for an AM radio antenna receiver tuner?

texts:
[![enter image description here][2]][2]
I am using some pretty rough, brute force and novice calculations, so if anyone knows a nicer method I am happy to learn.
I want to build an AM radio receiver from scratch. My oversimplified starting point was putting some numbers into the classic 'antenna Thevenin equivalent in series with parallel LC circuit'. Note this is before even giving the demod / amplifier / speaker section any impedance. The resistance is the equivalent resistance of the antenna, and I assume the LC circuit has negligible resistance.
From straightforward impedance blabla we have
$$ |\frac{v_o}{v_i}| = \frac{L\omega}{\sqrt{(L\omega)^2 + R_1^2(1-\omega^2LC)}}   $$
$$\omega_o = \sqrt\frac{1}{LC}    $$
And if I make a dodgy estimate of bandwidth by defining it as the distance (in terms of angular velocity) between the solutions to the amplitude function at amplitude = 1/2 of resonant amplitude:
$$ |\frac{v_o}{v_i}| = \frac{1}{2} $$
Which leads to a quadratic equation in omega. The difference of the solutions is the distance between the abovementioned solutions, and using the quadratic equation this eventually leads to:
$$(\Delta\omega)^2 = (\frac{\sqrt{3}}{R_1C})^2 + (\frac{2}{\sqrt{LC}})^2  $$
Now, apparently AM bandwidth is about 10kHz. Imagine we want to listen to CMAA Pinar del Río (580 kHz AM), we immediately know the required capacitance to be able to tune to this channel. With, say, 10^-12H that's about 0.0755F, converting the channel frequency to radians per second and so forth.
Now looking at the equation for the bandwidth, we require that $$\Delta\omega^2 = 10^2 [kHz]= 6.28 *10^8 $$
You can try plugging these numbers to solve for R, and you'll see we get imaginary resistance. The problem is that the natural frequency is larger than the bandwidth. Unless I have made incorrect assumptions about which frequencies we require, I don't think the equations are wrong. My radio works fine - so what's happening?
How do we get real resistance here and/or thus or otherwise find the required equivalent resistance for this oversimplified model?
PS
If we give the demod/etc. part an equivalent resistance R_eq in parallel with the LC circuit we have, for the bandwidth:
$$\Delta\omega^2 = R_{eq}^2(12\omega_{o,RC}^2+\frac{2}{RCL}-\frac{1}{L^2}) + \frac{4}{RLC}$$
Which doesn't look like it'll be much nicer to us w.r.t. tuning into frequency higher than bandwidth.


texts: Do I need a via or stitching cap when I transition between physical reference planes of the same potential?

texts:
I have the following layer stack up

Signal
Ground
Signal
Power
Ground
Signal
Ground
Signal

Layer 1-2-3 are tightly coupled

Layer 4-5 are tightly coupled

Layer 6-7-8 are tightly coupled

Total thickness is 120 mils

If I transition from either 1 or 3 to 6 or 8, is a via or stitching cap required in order to keep returns happy ?

I'm thinking I would because of layer 4.


texts: Video overlay / on screen display architecture

texts:
I want to take a NTSC/PAL component video and overlay graphics over it.
I am aware of solutions that either use the max7456 overlay chip, or accomplish it with just an AVR
but these seem to have limited resolution and are monochromatic.  Ideally I would like to have something comparable to the performance of this setup.

Here is what I know I will need:

Video decoder (to digitize NTSC/PAL)
Some sort of buffer/processor to overlay graphics onto the digitized frame
Video Encoder (to re-encode to NTSC/PAL)

The middle part is what I am not sure how to setup.  Are there existing chips that will automatically do this overlaying for me somehow, or do I just need a sufficiently powerful MCU and RAM to buffer/manually manipulate a bitmap? Ideally I would like to have something low cost, and preferably a single chip solution.


texts: What are some reasons for hand painted dots on chips?

texts:
I've seen lots of products with hand painted dots or markings on chips, what do they often mean? Obviously I understand everybody has their own reasons but could it be an industry common practice for QA or programming?
For example, this picture of an Xilinx CPLD has two painted dots. I've also seen ones where it's a sloppy line on the middle of the chip.
(Image source Wikipedia)


texts: Flashing and debugging with Eclipse (without jtag)

texts:
I'm a beginner in embedded system development and wonder if I really need JTAG emulator(?) or JTAG cable. Previously I learned stuffs using STM32-discovery and now would move to Sabre Lite. It uses freescale's I.MX6quad MCU. But I wonder how I could upload an executable file to the I.MX6quad. Since I don't have Jtag cable, I have no idea how to flash and debug the MCU. Would you please let me know if there is a way to flash and debug without JTAG, assuming you use Eclipse?

Thank you.


texts: Ground planes disposition in Ethernet connection

texts:
I am designing a board that will have sensible analog signals and a processor communicating with the external word via Ethernet and I want to avoid that common mode currents couple into my analog circuits. After reading some design tips, these are the sketch of the schematic and layout that make more sense to me. However, I have some doubts and I am seeking for clarification about the following topics:

Please, consider that the Ethernet cable is not shielded:

The RJ45 shield connects directly to GND_SHIELD and it will be galvanic bound to the metallic housing of the entire device. This was done to protect the system against ESD.
The LAN transformer IC 749020010A I am using integrates Common Mode Choke in the connector side.  Some design guides pointed that is important to connect the center tap of the connector sides’s transformer to the ground plane via an RC or C network(ref 1 page 22, ref2 fig 47), to provide a low impedance path to the common mode currents attenuated by the input choke. Therefore, I connected the center taps to the “GND_magnetic” via the resistors and connected this plane to the GND_SHIELD via the capacitor. However, I am not sure about it, because the second reference specifies that this plane should not be connected to the shield, while the first reference points that RC does need to be connected to the shield. In addition, I am not sure if is necessary to have a plane beneath the Ethernet differential lines, because it can couple common mode to this plane before passing through the choke.
The system GND is isolated to the connector voltage domain by the LAN transformer IC and connected to the GND_SHIELD by a ferrite bead, which avoid high voltage due to floating plane while blocking the high frequency common mode current to enter in the system ground by this connection. However, I have the following doubt about it: If the common mode currents circulated in the shield and the system GND plane is not connected directly to it, there maybe will some voltage bounce between these them. Could it lead to intensification of the electromagnetic emissions?
Finally: The use of transformers /chokes to block common mode currents is very common in design guides for Ethernet physical layer, but is not that common to USB physical layer design guides? Can I use the same filtering/isolation methodology to USB connection? Would it be a good choice?

Thanks in advance!


texts:
LM7812 voltage regulator is recommended to be used with decoupling capacitors at its input and output as in the below diagram:

And here is the part from the manufacturer Fairchild(see recommended C1 is 0.33uF):

But another manufacturer Texas Instruments have different C1 recommendation on their datasheet which is 0.22uF.

I have two questions:

1-) I don't have 0.33uF cap: but I have 0.22uF, 0.1uF and 0.01uF caps instead. For C1, can I use these three caps in parallel as their sum is 0.33 instead of a single 0.33uF cap?

2-) Why those two manufacturers recommend different C1 values for the same component(LM7812)?


texts: What value to use to convert ADC value to voltage?

texts:
While working on my project, I got to a point where I don't know the answer. I have a 10-bit ADC (the one incorporated in the ATMEGA328P) and it returns values up to 1023 (210 - 1).

The official documentation states that the equation to convert the values from the ADC to the corresponding voltage is:

$$
V = \frac{V_{in} \cdot ADC}{2^{10}}
$$

But, if the values go up to 1023, then wouldn't it be better to replace the 210 by 210 - 1?

Thanks.


texts: How to understand the block diagram of microcontroller Architecture

texts:
I am started learning pic18f4550 controller . I find it difficult to understand the architecture block diagram . i cant  understand how  peripherals, cpu core (eg ALU), data bus , program bus are interlinked. I have googled a lot but didnt understood.pic18f4550 block diagram

link : http://ww1.microchip.com/downloads/en/devicedoc/39632c.pdf
Page Number :13


texts:
We have a really weird issue which we just cannot get our head around.

In high level:

We have a unit which contains some electronics, we can access it with 4 cables 2 for power and 2 for communications. The power is 24V DC and communications is RS485.
We could not establish communication using a 10m test lead, it has been noticed that when we moved the cable the device functioned sometimes. The conclusion we drew was that the cable was broken somewhere. The cable was cut shorter to around 1m long and worked like a charm.

Fixing:

We tried to use two other long cables as we still needed to be sure that the system works with the required cable length. It did not work.

This is when we started to do some more testing and try to rule out the possible faults:

Correct length power and comms cable works fine with test apparatus
Short power and comms cable works fine for our actual apparatus
Short power and long com works fine for our actual apparatus
Long power short comms does not work with out actual apparatus
Long power and long comms does not work with our actual apparatus

We have concluded that the issue is with the power cable. The only variable that seems to have an effect is length of the power cable. We have experimented with three different long cables of different qualities, none of which have any effect.

We have one of the electronic components(comms and power as well) as a spare unit which we have tested with the same long cable and it does work. In the unit it self which we are trying to fix we have a power converter (in 18-75V out 24V) which we have no spares for. We have called the manufacturer and asked if they have encountered anything similar but they said they have not.

We have hooked up a multimeter to check the current draw, at short cable we get 0.6A while at long cable we pretty much have nothing.

There is a really small voltage drop at the end of the cable. The power supply we use is 24-28V 15A we have set the power supply to around 25.6V at the end of the cable we had 25.4V.

Currently we cannot access to any electronic as they are in an enclosure, we could open it up but we would like to avoid that if we can solve the issue without it.

In short, how could the length of the power cable effect the current draw from the system, why it would not draw anything when the cable hits a certain length?

Thank you in advance for any ideas you may share to help solve this problem.


texts: XBEE S2 RPSMA not working with batteries

texts:
I have a couple of XBEE S2 with RPSMA antenna
I'm using the xbee explorer(with arduino) and XBIB development board with X-CTU on a PC.

if I drive the arduino from the USB,,, it works... not really fine, but there's some data beeing sent and received.

However, as soon an i move to batteries (http://www.batteryspace.com/li-ion18500cylindricalrechargeablecell37v1400mah518wh---ullisted.aspx) NOTHING works!
the xbee xplorer's tx blinks but i receive nothing on the other end. the arduino's XBEE doesn't even receive anything.

i have other components connected and they are ALL working fine except for the XBEE. I know that the program is still there and the power is OK. what can be wrong!

here's a simple schematic

simulate this circuit – Schematic created using CircuitLab


texts: Basic electronic: frequency in power supplies, and feeding 400Hz to a 50Hz device

texts:
This question led to this other question, which in turn is now spawning the one you are going to read.

As much as I understand, AC is more efficient for long distance transmission and much more versatile because it allows to be transformed from one voltage to another. To have AC you obviously need it to periodically reverses direction (otherwise is just DC), and for everyday appliance the frequency at which this happens is 50 or 60 Hz mostly for historical reasons.

So once you plug a device this contains a simple rectifier that change the direction of one of the ripple so that the signal is more akin to the DC (usually) needed for the device to work.

Also, I've read that in the old times the supply signal was used as the frequency reference for devices that needed it.

So, all of this raises a question: what happens if you feed a (for example) 50Hz device with a 400Hz supply? Is there something implicit in the rectifier so that it can work only at specific frequencies? Or will it still work and just happen to produce a "more DC" supply (that is, with less pronounced ripples)?


texts:
First: I'm not a professional. I just want to know what is possible and if i'm on the right track.

Second: I want a little microcontroller which just measures (for example) the temperature and send it to my server (can send/receive bluetooth). It should be a SoC. I googled a lot and found an ARM Cortex M0 at nordic semiconductor which has built-in bluetooth (2,60 $) which I want to use. Before I continue and look for a professional to help me I want to ask you ...

The question:
Is it possible to put this ARM cortex M0 with built-in bluetooth on a little board with some pins and connect it to a small power source? Would this work, or would I need a lot of components (resistors to pins, capacitors etc.) on that board?

The solution should be as simple as possible to keep it small.

I also googled for existing solutions, but they where 10 times more expensive than a simple ARM Cortex M0 would cost. I found a little iBeacon/Beacon which would cost 4$ with an ARM Cortex M0 and also some pins to connect some sensors, but it was to large (lot of capacitors, resistors, ...).

EDIT:

this is the ARM I found: nRF51822

this is the data sheet


texts: Unable to trigger NPN Transistor from 4017 decade counter output

texts:
I am trying to make a unipolar stepper motor driver circuit. As a development landmark, I am trying to first run LEDs using the driver. Attached is my circuit.

My 555 timer generates regular pulses for the decade counter. The outputs (0-3) of the decade counter is connected to LEDs. Till this point, this works good. All LEDs light up one at a time. Output 4 of the counter feeds back to reset button as my stepper motor has just 4 inputs.

My stepper motor takes +ve on the common wire and needs to get -ve connection on the other 4 wires. Hence, I need to use transistors to connect the -ve of the power rail to the stepper motor.

But when I insert NPN transistors in place of the LEDs, have the output of decade counter fed into transistor base and have the LEDs connected between the collector and positive supply with emitter connected to negative supply, the transistor does not switch on.

What could I be doing wrong? I am using the following components -

12 V DC Supply

555 Timer

4017B Decade counter

2n2222 NPN Transistors

Various resistors between 1K to 10K.

In order to make sure the transistor is in good state, I inserted it into a different bread board. Then connected LED between collector and +ve voltage, connected emitter to -ve and then connected base with 220, 10K and 470 K resistors to +ve. It works. So looks like the transistor is in a good state, its just that the 4017 output is unable to drive it.


texts: How to initialize MSP430FR5969 Comp_E Module

texts:
I've tried to implement a resistor based temperature sensor on a MSP430 FR5969 . The User Guide is fairly straightforward on this point. I configured all registers according the user guide but unfortunately I am not able to get the comparator working. Right after starting the comparator it raises an interrupt even if none sensor is connectd. I guess there is an error in my initialization method.

I hope anyone can help with this problem.

Here is the initialization method

    //Komperator beenden
stop_COMP();

CECTL0 &= 0x0000;
CEINT &= 0x0000;

// Pinbelegung konfigurieren
connect_input();

switch_pin_to_high_impedance_input(R_SENS_PORT, R_SENS_PIN, -1);
switch_pin_to_high_impedance_input(R_REF_PORT, R_REF_PIN, -1);

CECTL1 &= ~(CEMRVS); //Set to VREF0
CECTL2 &= CERSEL;

/*
 *  If CEREFLx is changed from a non-zero value to another
 *  non-zero value, the interrupt flags may show unpredictable behavior. It is recommended to set CEREFLx
 *  = 00 prior to changing the CEREFLx settings.
 */

CECTL1 |= CEPWRMD_2; // Ultra-low-Power mode
CECTL1 &= ~CEOUTPOL; // nicht invertierender Ausgang
CECTL1 &= ~CEEX;     // Eingänge des Komperators nicht vertauschen

CECTL1 |= CEF; // Ausgang  filtern
CECTL1 |= CEFDLY_1; // RC Glied mit 900 ns als Zeitkonstante
CECTL1 &= ~CEIES; // Rising Edge triggert Interrupt

CECTL2 |= CEREFACC; // Clocked (low power, low accuracy) mode

/*
*   If CEREFLx is changed from a non-zero value to another
*   non-zero value, the interrupt flags may show unpredictable behavior. It is recommended to set CEREFLx
*   = 00 prior to changing the CEREFLx settings.
*/

CECTL2 |= CERS_1; //Vcc with resistor ladder

CECTL2 &= ~CEREFL_3;
CECTL2 |= CEREFL_0; // Referenzspannung: 2.5V
CECTL2 |= CERSEL; // Referenzspannung an negativen Eingang des Komperators legen

CECTL3 |= CEPD4;

setupTimerForMeasurement();

Code for pin initialization

    //Komparatoreingang
    P1DIR &= ~COMP_PIN;         //Port1.COMP_PIN  als Eingang definieren
    P1SEL0 |= COMP_PIN;         // Aktivieren der Tertiärenfunktion (Komperatoreingang)
    P1SEL1 |= COMP_PIN;
    P1OUT &= ~COMP_PIN;         // Ausgang auf Low setzen

    // RSensPin
    P3DIR |= R_SENS_PIN;            //Port3.R_SENS_PIN  als Ausgang definieren
    P3SEL0 &= ~R_SENS_PIN;          // Aktivieren der Hauptfunktion (GPIO)
    P3SEL1 &= ~R_SENS_PIN;
    P3OUT &= ~R_SENS_PIN;           // Ausgang auf Low setzen

    // RRefPin
    P3DIR |= R_REF_PIN;         //Port3.R_Ref_PIN  als Ausgang definieren
    P3SEL0 &= ~R_REF_PIN;       // Aktivieren der Hauptfunktion (GPIO)
    P3SEL1 &= ~R_REF_PIN;
    P3OUT &= ~R_REF_PIN;        // Ausgang auf Low setzen

    // Konfigurieren des Komperators
    CECTL0 &= ~CEIMEN;          // - Eingang des Komperators auf interne Ref.-Spannung legen

    CECTL0 = CEIPEN | CEIPSEL_4;            // + Eingang des Komperators nicht auf interene Ref.-Spannung legen
                // Kanal 4 (Pin COMP_PIN) an Eingang legen

    CECTL3 |= 1 << CEIPSEL_4;       // Input Buffer deaktvieren, um Energie zu sparen
    //CECTL2 |= CERSEL; //Set Vref to go to (-) terminal

    CECTL2 = CERS_1 | CERSEL | CEREF04;


texts: I have a phone answering machine which drops out on the frequent momentary power interruptions we experience in florida. It has an 11 volt 350 ma supply. all I want is something to momentarily bridge the dropout. not something  like an ups. any ideas?


texts: Help building a CANbus receiver and sender unit

texts:
I am an engineer in the marine industry and work as a commissioning engineer and need to build something that I can connect to each sensor for alarm testing. The sensor is a thermocouple that is hard wired into the CANbus node. CANbus is the area where I have the least understanding, not taught when I was at uni.(If anyone has links to indepth information, please send me the link)
I would like to be able to connect to the CANbus sensor and read it, while also being able to send a false output temperature CANbus signal to raise the temperature being read by the alarm system. I have looked at what is available of the shelf and can´t find anything that can do this. I can see there is some opensource software and making a CANbus reader seems not so hard, but sending a temperature signal over CANbus seems rather difficult.
CANbus system runs on 13v with a 120 Ohm resister at the bus end. There are 4 bus with about 6 nodes on each. There are 6 wires in each bus cable. 2 are shields ard the other 4 which run to each node are
1)CAN Hi
2)CAN Lo
3)return
4)13v

Thanks in advance


texts:
I have a system arm that free-ranges within a certain area.  The arm swings, translates and rotates about a vertical axis which sits atop a mobile base.  The mobile base can move any direction in the X-Y plane.  It's movements are strictly programmed but I would like to start a new version that is semi-autonomous.  This new version would need to receive feedback on 3-axis positioning, speed and rotation relative to a fixed point at the edge of the enclosed system (or relative to the position at which it is initialized).
Sensor feedback is completely new to me but I am willing to dive in.  Could someone recommend a great starting point for me?  Thanks!


texts: Weird Temperature Reading Fluctuations, LabVIEW

texts:
Click the "edit" link below the image in the preview instead. -->

simulate this circuit – Schematic created using CircuitLab

First I apologize for the crappy drawing, but I wanted to give a basic overview of what it looks like. It doesn't show my breadboard though so those unnamed ports that look like they go into the Arduino actually go into the power and ground slots on the breadboard which are then connected to the Arduino.

I have a temperature 514TC sensor that I am connecting to my Arduino MEGA and I am reading the outputs from a LabVIEW VI. My question is that I also have a voltage divider on my breadboard and it causes my temperature readings to fluctuate. The thing is though, it only fluctuates IF I read both the temperature and voltage at the same time! So if I keep everything the same and only read the temperature the outputs are fine, but if I try to read the temperature of my sensor and the voltage of the voltage divider the outputs start to fluctuate rapidly. Does anyone have any idea how to fix this?

EDIT: The pictures show the heart of the problem. You can see in the blue picture of temp and voltage I get fluctuations. You can see the points where I removed power from the voltage divider and gave it back power. The bottom picture has everything the same but I read temperature only and I get no fluctuations, even with the voltage divider receiving power.


texts:
I don't know how to search this problem on google so I was hoping you guys could help out.

I have made an eagle part by myself. I have used the top layer for the pads (just click pad and then adjust size) and I used 21 layer for the package width and stuff. Now I also get a clearance under and around the package with the 21 layer. Does anybody know how to fix it? It is quite strange because the bottom ground plane also gets affected by this. See picture:


texts: Using a TLC5940 to control LEDs with different forward voltages

texts:
I am trying to build an LED matrix (64x32) of RGB LEDs using a TLC5940 current sink LED driver.

The forward voltages of the LED components for each RGB LED are:

R: 1.8V
G: 2.8V
B: 2.8V

The driver maintains a specified current which helps because I can supply 3.3V to all LEDs. This however means the TLC5940 has to dissipate the extra power.

Can I provide the R and GB components with 1.8V / 2.8V respectively (regulated down with a more efficient switching circuit) and still have it go to the constant current source driver? In other words, can the supply voltages to the R and GB components be different if they are being sunk into the same current source?


texts:
This is my first attempt to work with a servo and I'm using this tutorial.  I have a "TowardPro MG996R DIGI HI TORQUE" servo directly connected to my Arduino Uno as follows:

I also created the following code to upload onto the Arduino:

#include<Servo.h>

Servo myservo;
int servoPin=9;

void setup(){
  myservo.attach(servoPin);
}

void loop(){
  for (int i=0; i>= 20; i+=20){ // increment by 20 degrees
    myservo.write(i);
    delay(1000);
  }
}

After hooking up the servo wires to the Arduino (unpowered), I then hooked up the USB power source to my Mac computer (no code uploaded yet).  However when I did this, I noticed a very strange reaction:

The servo motor instantly started rotating in small increments about once every second or so, like a pulsing.
The message "A new network interface has been detected" keeps popping up and closing at the same frequency as the servo's motor.
The periodically appearing message prevented me from uploading my code onto the Arduino.

Of course, I thought something was wrong and promptly tried to disconnect the power source and reconnect it several times with no improvement.  So, I tried the following steps:

Disconnect the USB power to the Arduino.
Disconnect the servo wires from the Arduino.
Reconnect the power usb to the Arduino.
Upload the code.
Disconnect USB power source.
Reconnect servo wires to the Arduino.
Reconnect the USB power source.

Now, I'm having the following problem:

The servo motor does not rotate.
A hissing noise is coming from the servo.
The message "A new network interface has been connected" does not appear.
My computer does not recognize anything at all connected to the usb port where the Arduino is connected to.

At this point, I have no idea what the problem is or how to fix it.  Any help to understand where I went wrong and how to remedy it would be greatly appreciated.


texts: Find the DC component of a Full wave rectifier (DC Power supply)

texts:
I was asked:
Find the DC component of

---|Full Wave rect| -- Vr(t) ---|Filter| -- Vo(t)

$$ V_r(t), V_{dc}  = ?$$

Where  $$ V_r(t) = |V_m sin(\omega_o t)|$$

I know that the DC component of #$V_r(t)#$ is the Avg value of the wave which I believe is an integral but I don't know for sure and am having trouble finding a direct answer to the question.


texts: Need some tips on using hot air soldering station for my project

texts:
I and my friend have designed a 0.8mm 4 layer PCB for our project. The top and bottom layers are for signal traces and the middle layers for power and ground. All the components that we use are SMD type and also we have few components on the board which contain plastic.
We did some experiments on soldering the components to the board and have failed a few times. The solder paste which we are using is lead-free solder which melts at 217 degrees celsius. Every component which we are using has a max peak reflow temperature of 260 degrees celsius.
The first time we tried to solder the components we used our hot air soldering station at 260 degrees celsius but we weren't able to solder the components at all, the solder paste wasn't melting. Then we tried higher temperatures, but the stone plate(where we had our PCB placed) seemed to absorb the heat and the board was losing temperature quite quickly.
Then we did some research and saw articles where people were using more than 300 degrees celsius, sometimes 350 and even 370. When we tried these temperatures the soldering was kind of successful, the solder paste melted and everything was soldered correctly. But the plastic components, buttons and the connector, have melted... Which weren't melting at 260 degrees celsius.
Also, we tried soldering some components on 2 layered PCB and everything was soldered within seconds even at 260 degrees celsius. We think that means that our PCB has way more thermal mass because it has 4 layers and also entire ground plane connected to every layer via many vias.
The last thing that's left is preheating the board evenly, so 260 degrees celsius would be enough. We don't have a hotplate, nor infrared heating bed. Considering our board properties and that the hot air soldering station is the only tool, can you guys give us some tips on how to preheat the board, what temperatures to use for preheating and soldering, and maybe which nozzles are better for such purposes?
Thanks in advance!


texts: Impedance inverter transformation from series lumped resonators to lambda/2 resonators

texts:
Suppose I have the following series of filter transformations beginning with a lumped element bandpass filter and concluding with shunt susceptances-

The transformation from step (a) to step (b), and from step (c) to (d) makes intuitive sense to me based on the general theory of j and k immitance inverters.  But going from step (b) to step (c) does not make intuitive sense to me.  A half-wave line resonator typically forces the input impedance looking into it to be equal to what is connected on its output/load side.  But how does a series lumped resonator end up being equivalent to a half-wave line resonator in this instance?


texts: What are these soldered/un-soldered dotted-shapes? on the traces which don't have soldermask?

texts:
Please look at this image(see the soldered/un-soldered dotted-shapes which are identified by arrows).

This circuit belongs to a laptop adaptor.

What are these soldered/un-soldered dotted-shapes?
As I can see, each trace just has one of them. why?
Why aren't they connected to  ̶t̶h̶e̶ ̶ ̶"̶c̶a̶r̶g̶o̶ ̶c̶u̶l̶t̶s̶"̶? those soldered traces?
Does this question have something related to this question.

Why are these traces shaped in such way?


texts: Designing a high power analog current controller using an opamp+MOSFET push-pull

texts:
I am trying to design a voltage-controlled current source supplying 0 -> +/-2Adc into a 20Ohm, 100mH load from a +/-100Vdc supply. I need at least 3kHz bandwidth for small signals, but my current circuit lags well below this point and I am struggling to find out why. Here is the circuit :

Note that the opamp is supplied with +/-120V even though it is impossible - I need to get that circuit to work before getting to how to drive the gates of the transistors.

Transients for 1kHz control (Green: output of MOSFETs, light blue: output of opamp, dark blue: sense, red: control):

I do not know why the voltage is so slow to decrease. Where could it come from?

Edit: I've tried with a LT1226 for example and it works very well (10kHz bandwidth)... Why?

My second problem is how to drive the gates of the transistors (which, looking at the simulation, require a higher voltage than Vds): a) if I buy lab supplies to supply rails higher than the +/-100V, or b) if I make do with the lab supplies I have. Any suggestions are welcome...

Edit: Dissipation, cost and space is not design drivers, but speed and stability are.


texts: Switching backlight to RGB in the following monitor C24FG70

texts:
I have the following monitor: Samsung C24FG70. Is it possible to change the white led backlights with RGB leds? Possibly the smd APA102 with the following microcontroller: ESP8266. How could i hook this into the current LCD controller board? any input is appreciated.

The leds operate at 5v .2 watts. I can have a separate five volt power supply for them. and run the data and clock to them from the ESP8266. just not sure how the works the the LCD controller.

Any input is appreciated. Where could i get the current schematic for the board that is in the Samsung  C24FG70?


texts: HC-06 Bluetooth module not responding to any AT commands

texts:
I am trying to interface with a HC-06 module but I can't talk to the module over serial.

My VCC is connected to 5V (also tried 3.3V) of my Arduino Uno, and GND is connected to ground of it (obviously). I've connected the RXD to pin 11 and TXD to pin 10 (also tried the opposite too). The LED on the module is blinking (waiting for connection) Here is my code:

#define BT_RX 10
#define BT_TX 11
#define BAUD 9600
SoftwareSerial bt(BT_RX, BT_TX);

in setup method:

pinMode(BT_RX, INPUT);
pinMode(BT_TX, OUTPUT);
bt.begin(BAUD);

Then, I'm trying to send the simplest AT command to the HC-06 (without newline character, I do know it's different from HC-05). If everything works, I should get an OK response. I've tried all the baud rates available,  both 3.3V and 5V, and tried inverting the RX and TX pins, yet I've got a response from the module. However, the module itself works. When powered on, my Bluetooth devices see it as HC-06 and can connect to it with the default password 1234 (other passwords fail). When my devices connect to it, the blinking light turns to solid ON, meaning that the connection succeeded. My serial console (when I connect using putty or SerialTools etc) can accept input. The Bluetooth module itself does send and receive data. When I short the RXD and TXD pins, I immediately receive what I typed back in my terminal. But I couldn't find any way to talk to the device over Arduino. I've read many tutorials and datasheets of the device, but I just can't talk to it. I am new to electronics (but most of the times understand what's going on easily). What am I doing wrong?


texts: Why interrupt preventing sending of data in EFR32FG14

texts:
I have tried to implement a simple case
where ,in a case i send "a" the controller sends back 0F in endless loop
in a case i send "b" the controller sends back 1F in endless loop
in a case i send "c" the controller sends back 2F in endless loop
The program keeps sending the old value over and over(with small delay) till it gets a new command.
In reality when i sent a command letters it sent back nothing.
Where did i go wrong implemeting the RX interrupt?
Thanks.
I have checked the pin connection acording to the datasheet page 157 location2 rx portA pin3(P2) ,tx port A pin2(P0) as shown in the photo bellow.
https://www.silabs.com/documents/public/data-sheets/efr32fg14-datasheet.pdf

#include "em_device.h"
#include "em_cmu.h"
#include "em_gpio.h"
#include "em_usart.h"
#include "em_chip.h"
#include <stdint.h>
#include <stdbool.h>
#include "em_emu.h"
#include "bsp.h"
#include "bsp_trace.h"

uint8_t received_flag=0;//
// Receive data buffer
uint8_t buffer;
uint8_t tx_buffer=0x6F;
uint8_t tx_buffer_new=0x06;

void USART0_RX_IRQHandler(void)
{
    received_flag=1;
  // Get the character just received
  buffer = USART0->RXDATA;

  switch (buffer)
      {
        case 'a':

            tx_buffer_new=0x0F;
        break;

        case 'b':
            tx_buffer_new=0x2F;
        break;

        case 'c':
                    tx_buffer_new=0x4F;
         break;

        default:

        break;

      }//end switch
  // Clear the requesting interrupt before exiting the handler
  USART_IntClear(USART0, USART_IF_RXDATAV);
}

int main(void)
{
  uint32_t i;

  // Chip errata
  CHIP_Init();
  CMU_ClockEnable(cmuClock_GPIO, true);
  CMU_ClockEnable(cmuClock_USART0, true);

  //EFR32fg14 LOC2 page 157 data sheet TX P0
  GPIO_PinModeSet(gpioPortA,2, gpioModePushPull, 1);

//EFR32fg14 LOC2 page 157 data sheet RX P2
  GPIO_PinModeSet(gpioPortA,3, gpioModeInput, 0);

  GPIO_PinModeSet(gpioPortA, 5, gpioModePushPull, 1);

  // Default asynchronous initializer (115.2 Kbps, 8N1, no flow control)
  USART_InitAsync_TypeDef init = USART_INITASYNC_DEFAULT;

  // Configure and enable USART0
  USART_InitAsync(USART0, &init);
  //datasheet page 157 location2  rx portA pin3(P2) ,tx port A pin2(P0)
  USART0->ROUTELOC0 = USART_ROUTELOC0_RXLOC_LOC2 | USART_ROUTELOC0_TXLOC_LOC2;
  USART0->ROUTEPEN |= USART_ROUTEPEN_TXPEN | USART_ROUTEPEN_RXPEN;

  // Enable NVIC USART sources
  NVIC_ClearPendingIRQ(USART0_RX_IRQn);
  NVIC_EnableIRQ(USART0_RX_IRQn);
  NVIC_ClearPendingIRQ(USART0_TX_IRQn);
  NVIC_EnableIRQ(USART0_TX_IRQn);

  while (1)
  {

      if (received_flag==1)
      {
          USART_Tx(USART0,tx_buffer_new);
          USART_Tx(USART1,'\n');
          tx_buffer=tx_buffer_new;
          received_flag=0;
      }
      else
      {
          USART_Tx(USART0,tx_buffer);
                  USART_Tx(USART1,'\n');
      }
      for(i=0;i<115;i++)
      {
           GPIO_PinOutSet(gpioPortA,5);
           GPIO_PinOutClear(gpioPortA,5);
       }

    // Enable receive data valid interrupt
    USART_IntEnable(USART0, USART_IEN_RXDATAV);

  }
}


texts: Active 433Mhz RF tag battery life question

texts:
I am exploring the world of RTLS system and trying to produce one on my own. I chose 433Mhz frequency for its penetration capabilities and I produced a PCB mounting CC430 TI family MCU-transceiver, two quarter-length PCB antennae to reduce heading problems in RSSI measurements and a 250mA battery. Right now the tag is transmitting a 30 bytes packet (using the SimpliciTi communication protocol from TI) with 0dBm every minute at 1.2kbaude data rate. The receivers use pretty much the same circuitry except that they mount a half length dipole rubber duck antenna and they are wired at the power line.

The beacon sent by the tag serve for a reliable trilateration in a 30 meters range indoor with sporadic and slim (10 cm) concrete walls

My experiments show that the battery gets completely drained just after 3 days of transmitting a beacon every minute, which is probably due to the extremely low data rate used (which I suspect it has an impact on the readings' accuracy due to small fading phenomenon and multipath).

I would like to have some advice on best practices for extending battery life in an RF application such as the one I described without compromising too much the accuracy of the RSSI readings and suggestions on how and what instruments I can employ to test such drainage. The desired battery life for the tag is 6 months.


texts: sense movement of muscles via electronic signals

texts:
I'd like to sense when a certain muscle is contracting or releasing, for instance the movement of one finger over another.

Is there any existing work to do this with sensors / arduino / galvanic skin response?


texts:
I need about 50mm of coax hardline. I don't have any at home, but I do have a lathe, some copper, and some teflon stock.

Can I make my own coax hardline on the lathe? According to my calculations, for a 1mm center conductor, and a dielectric constant of 2.02 (PTFE), the outer conductor should be about 3.27mm for 50 ohms impedance.

I have a 3.25mm drill which should be close enough.

Would this work?

EDIT:

It's for building this antenna:

The antenna is simply a turnstile antenna, for 1.7ghz. hardline is used for support.


texts: Looking for a board-to-board SMD connector found in Google Pixel XL phone

texts:
I am looking a particular connector found in a Google Pixel XL, searched for days without luck. It looks like a Mezzanine Connector but different.

I took some measurement on it and took some pictures:

Plug: 1mm × 5mm; pitch size 0.35-0.4mm
Receptacle: 3mm × 6mm; pitch size 0.35-0.4mm


texts: How do I control several hundred individual leds with Arduino(s)?

texts:
I am working on an electronics project which involves hundreds of LEDs. (Talking upwards of six to seven hundred LEDs...a lot, I know.) Is there any way to control this many LEDs with one or a couple Arduinos? I would like to be able to access/control each LED individually as what I am wanting to do is plot LEDs onto a wall map of the world. I will then interface Arduino with Google Analytics and when someone navigates to my site from a certain place in the world, the LED closest to their region will light up in almost-real-time.

Any help would be appreciated. Thanks! I've tried to research some and read about multiplexing and charlie-plexing, but those seem to max out at 100 or so? I'm assuming I would need external hardware/components to be able to control this many LEDs, but what exactly would I need to make this happen? Has anyone else ever created an LED matrix this large?


texts:
At our company, we are in the process of finishing to develop a toy prototype.

I need to estimate the "production" price of all the components.

I was able to gather all the price from every manufacturer of every components in quantity of > 5000.

However, the sums of each individual price is really high even in quantity of 10000, and when I add a plastic enclosure, the PCB, and assembly, it is clearly not competitive with similar products.

Does anybody have some experience in this field, and could share his finding on how to optimize the price of a product in a reasonable range ?

For example, I bought and analyzed an Android 7'' Tablet available on AliExpress for 42.00$ (shipping included). Then, I tried to find every components in quantity of 10000 (Capacitive 7'' LCD Screen, Large capacity LiPo battery, WiFi, Bluetooth, 4GB Flash, Dual Core >1Ghz processor, Speaker, Vibration motors, etc.). For now, without assembly and plastic case which are hard to estimate for me, sums of every component price is over 500$, which is already more than 1000% higher than their actual "sell" price, testing, shipping and profit included on their side.

I don't need to create a product 1000% less expensive. But since it is a toy, it can't be as high as it is currently.

Do I need to replace every components by cheap part found only in Asia market?
Do I need to buy in quantity of 500k / 1M to have a good price?
Do we create the prototype first locally, and then ask a second partner team in Asia to redo it completly with their products ?

If anybody have some clue to help me on this topic, I would really appreciate it!

Thank you !

Simon


texts: I have the following transformer: Hammond 266S6 Dual 117Vac primaries (BLK-WHT and BRN-ORG) and Dual 3.15Vac secondaries (Red-BLU and GRY-YEL). I would like to be able to create a switchable output of 3.15Vac or 6.3Vac into a two wire lead. I need help with a wiring diagram and the selection of a switch.


texts: How does a CRT television flyback really operate

texts:
I am surprised that no-one has already asked this question (unless I've missed it), because it affects all those DIY guys dealing with high voltage. I have spent hours on the web to find how to use a CRT television flyback transformer to generate high voltage, and indeed, there are infinitely many schematics etc. on this subject: Basically, all the circuits I've seen use a supply somewhere between 12-30V DC, 3-5A, and they need an external wiring around the primary (not the internal primary coil). They almost never say if their circuit works with an internally rectified flyback (or not). Furthermore, these circuits are in general very inefficient (they dissipate a lot of heat). But that's not the point here. In CRT televisions, I know that the flyback works at 150V DC bias (what does it mean exactly?), in the rare cases where it is possible to find the spec of the flyback, it is very incomplete (e.g it says nothing about the inductances of the coils, the capacitance, the internal rectifiers). Even more annoying, I was unable to find any "real CRT television flyback" circuit that would have explained to me how they made the high voltage production efficient inside televisions. Well, I guess there are reference books on how to build a television, but even if I find them, it will probably be too hard a task for me to obtain these informations.
To sum up my questions are:

How the 150V bias is used to improve the efficiency of the flyback (this question must probably be linked with the third question)
I know there are different kind of flyback topologies (resonant, quasi-resonant etc.). Is there a usual topology used in CRT television flyback (quasi-resonant?)
A schematic using the topology of your choice that explain only the high voltage production in CRT televisions (not the other features also related to the flyback like the electron beam deviation). To put bones on flesh, here is one of the most detailed flyback schematic I've found in the web. It can be used to answer the question, but that's not mandatory.


texts: Help required performing Single Master - Multiple(upto 16) Slave SPI Communication using MSP430

texts:
I am planning to use MSP430F6638 for SPI Communication between a single MSP430 Master and multiple MSP430 Slaves. I am using a 4x16 Multiplexer before each Slave for providing the Chip Select Signal. This allows for using 4 GPIO wires to address 16 Slaves.
I am curious about the following issues and would like to have suggestions about the possible solutions.

The wire distance goes up to a maximum of 10m, will I face clock synchronization issues? What can I do to solve it?
Should I use unidirectional line buffers on the CLK, SOMI, MOSI pins and Chip Select GPIO wires in order to be able to address 16 Slaves? As for the fan-out, the MSP430 datasheet says (as I understood) that fan-out must not increase 48mA on all pins combined and I am using some other peripherals simultaneously, so it’s difficult to calculate the remaining capability.
Should I try going for a Daisy-Chain configuration? Does anybody have experience of writing software for Daisy Chain? Will it be of help using a Real Time Operating System or SYS/BIOS for writing the complex firmware required in case of Daisy Chain?

I would highly appreciate useful suggestions and comments. Thanks


texts: Why do power grids tend to operate at low frequencies like 60 Hz and 50 Hz?

texts:
I understand that a two-pole AC generator has to rotate at 3600 rpm (60 Hz USA) in order to maintain a 60 Hz frequency and higher frequencies would require these generators to spin even faster which could be problematic.
I also understand that increasing the number of poles would allow the generator to spin slower, but it would require more complexity and cost. However, are there other reasons that power grids tend to use lower frequencies?


texts:
I'm using MCP6231 as voltage follower exactly like in pic below. When voltage at non inverting input is at level of 1.5V the output has only 0.8V. I have put 100nF ceramic capacitor close to the supply pin. Circuit is powered by 3,3V LDO regulator. Do you have any idea where may be source of this error? I use Vout pin to drive REF pin in INA333.

EDIT:
Here is pic of my PCB layout


texts: How to use center tapped transformer's one connection?

texts:
Im trying to build a Battery charge controller described on this link http://www.circuitsgallery.com/2014/01/battery-charge-controller-circuit.html

in the circuit they used a 0-15V/2A Transformer with bridge rectifier, i couldn't find anywhere 0-15V/2A transformer, but i found a center tapped 2*15V / 2A transformer.

so my question is, will i be able to use center tapped transformer's middle wire and one of two wires of output as AC input for above circuit without changing the original circuit?

i meant will this work if i connect like below diagram?


texts:
I am using these RF link modules for a project since I need a cheap, small, and simple wireless link between two microcontrollers. The data being sent is a single integer and can be spam sent to prevent any mistakes in the data over the air.

http://www.seeedstudio.com/depot/433mhz-rf-link-kit-p-127.html?cPath=139_140

However, I want to be able to use multiple of these one-way wireless connections in the same area and in order to prevent them from jamming each other out, they have to be different frequencies. The RF link's I can find are always either 315 or 434 mhz and dont come in any more frequencies. I was wondering if there was a way to alter these to change the frequency (im looking for about 5 different frequencies) so that they dont all interfere with each other.

I could use a transceiver module, however for the simplicity of the communication, these are generally overkill. In addition, they are almost twice the cost of these links when you buy one for each of the microcontroller.

Can anyone help me understand how to change the frequency of these, or if there are any websites where you can buy these RF links in more than two different frequencies?

Thanks
Din


texts: How can I limit the ringing time and amplitude of an ultrasonic receiver that has just been hit by an incoming wave? [Note - just adding a resistor in parallel does not work well]. Any known techniques?


texts:
I have a traditional circuit (a conductor wire, and voltage source and a resistor). The voltage source may be a battery in this case.

My questions(s) are:

From where do the electrons that flow in the circuit come from? Do they come from the wire or from the voltage source? I assume they come from the wire itself since the conductor has electrons in its last level that it can easily get rid of?
Looking at voltage in primitive terms: Is it a kind of repelling power? For example, will a negative voltage source repel electrons in the conductor, thus causing a current? Is that correct?


texts: How to generate signal with glitches in VHDL?

texts:
I am working on an assignment in which I have to report the number of glitches in a signal.

For the testing purpose I was wondering how can I generate a signal with glitches in VHDL?


texts: what is the name of this yellow component in the motherboard?

texts:
I am not an electrician and I have no idea what is the name of this part on the image.

It makes a strange high frequency noise and I suspect thet the fault of this item causes my tv not to turn on. It has the following text written on its side:

MSC TY-T0129 122103

The tv is logik l22fed12. Is this component tv specific or can I buy a similar one? The main question is the name of the component but I would be happy if you could tell me whether I have any chance to make my tv up and running by replacing it or not.


texts: How to troubleshoot a switched-mode power supply?

texts:
I am trying to repair a switched-mode power supply, but as of now I have no success.

The problem can be described as following:

The supply does not output any voltage whatsoever. The fuse never blows, even though the supply is obviously faulty. There are no indications that any of the components have charred. My multimeter is reading voltage after the rectifier D101, but there is no voltage whatsoever on the secondary side of the transformer T101, so the fault must be somewhere on the primary side of the supply. I am also able to read 315V DC on C111. I tested the components in circuit (with the mains supply off, of course), and they seemed to be fine, so I am really starting to become frustrated.

So do you have any suggestions on how to approach a problem like this one? Are there any specific things that would be sensible to measure?

You can see the schematic below:

Thank you for your help in advance!


texts: Control different functions using the same push button. ARM 7

texts:
I am trying to implement a small piece of code, and can basically be simplified to the following.

I have three different LEDs (say P0.0, P0.1 & P0.2).
I have one push button that when pressed should first switch on the LED at P0.0. When pressed again should switch on P0.1 and so on.
The LED is to remain on until the next push button is detected.

In the following test code, I am referring to each LED as a function.
My idea was to increment a counter and depending on the count, light up a particular LED.

The output of this code is not what I expect. There is no transition between functions. Any suggestions on how I could restructure this code would be helpful.

I do not with to use interrupts for this code.
Also, I have not included debouncing as I am targeting to be able to reproduce this code from scratch in 15 minutes.

else if ( SW1 != (0x00000002) )  //when pressed
    {
    delay();  //for debouncing
    count++;
    }

    if (count == 1) {
        IO0SET = (1<<0);
        pattern1();
}
 else   if (count == 2) {
        IO0SET = (1<<6);
        pattern2();
}
     else   if (count == 3) {
        IO0SET = (1<<7);
        pattern3();
}

Is there a way in which I can break out immediately of the current function, instead of having to wait for it to finish?


texts: Understanding power requirements for MCU, by example

texts:
New to electronics and trying to understand how to read and interpret data sheets for MCUs, particularly w.r.t. voltage and current supply.
I'm trying to understand the voltage/current specifications for this Atmel evaluation board, as it has seemingly contradictory verbiage within its own user guide.
Certain verbiage suggests the board requires a 5V power supply:
From §3.3 Power Sources:

"External Power: 5V ±2% (±100mV) for USB host operation. 4.3V to 5.5V if USB host operation is not required."

From §3.4.2 Xplained Pro Power Header:

"The power header can be used to connect external power to the SAM R21 Xplained Pro kit. The kit will
automatically detect and switch to any external power if supplied. The power header can also be used as
supply for external peripherals or extension boards. Care must be taken not to exceed the total current
limitation of the on-board regulator when using the 3.3V pin."

To me, these two sections contradict each other. One one hand its saying to operate the board around 5V, but then elsewhere it says never to bring the board higher than 33V. Also, in that same table in section 3.3, there's a column about current requirements that also seems to contradict itself. On one hand it says:

"Recommended minimum is 1A to be able to provide enough current for connected USB devices and the board itself. Recommended maximum is 2A due to the input protection maximum current specification."

Which to me tells me the board wants 1A - 2A of current at all times. But then it goes on to say that the USB devices require 0.5A (which I understand is the USB spec).
I am trying to understand:

What voltage/current the board itself recommends/wants to power itself without issue; and
What voltage/current is supplied to and expected from the GPIO pins (so I know what voltage/current compatibilities need to exist with any peripheral I hook up to them)

Thanks for any and all clarifications here!


texts: Anyone recognise this capacitor and its symbol (circle with dot)?

texts:
Trying to repair an old Hameg CRT oscilloscope and looking at the schematics for the HV Z board I see the following capacitor symbol (in red box):

The capacitor itself looks (vaguely) like this:

I'm not suggesting it is a vacuum dielectric cap, it just looks like this.  It's about 2 or 3 cm long with a glass tube and two metal ends.

The symbol is different from that used for electrolytics and other non-polarized capacitors (like polys and ceramics).


texts:
I am trying to use a member function in an interrupt. The function uses member variables so I created a global instance of that class to use it in a static function.
The problem is that I created a child class that should have the same interrupt. The interrupt is enabled in the constructor of the parent class, so it will be also enabled in the child class but with the wrong instance.

To use the interrupt functions in both classes, I put them in a separate header file "Utilities.h" so that I can included it in both source files. But doing void called_from_interrupt () { Instance_1.do_something(); } requires including the class header, which will create multiple definitions errors.

I'll put a short example of what I am trying to do, the original code is really long.
parent_class.h :
#ifndef PARENT_CLASS_H
#define PARENT_CLASS_H

class parent_class {

public :

    parent_class();
    ~parent_class();
    void do_something();
};

extern parent_class instance_1;

#endif

parent_class.cpp :
#ifndef PARENT_CLASS_CPP
#define PARENT_CLASS_CPP

#define LIBCALL_ENABLEINTERRUPT
#define EI_ARDUINO_INTERRUPTED_PIN
#include "EnableInterrupt.h"

#include utilities.h

parent_class instance_1;

parent_class::parent_class() {

    enableInterrupt(PIN_1, called_from_interrupt, FALLING);
}

parent_class::~parent_class() {}

parent_class::do_something() {

    //manipulate some member variables
}

#endif

child_class.h :
#ifndef CHILD_CLASS_H
#define CHILD_CLASS_H

class child_class {

public :

    child_class();
    ~child_class();
};

extern child_class instance_2;

#endif

child_class.cpp :
#ifndef CHILD_CLASS_CPP
#define CHILD_CLASS_CPP

#include utilities.h

child_class instance_2;

child_class::child_class() {}

child_class::~child_class() {}

#endif

utilities.h :
#ifndef UTILITIES_H
#define UTILITIES_H

#include "parent_class.h"

#define PIN_1  10

static void called_from_interrupt() {
    instance_1.do_something();
}

#endif

Do you have please an elegant solution for that ?


texts:
I have two questions about dot convention for the ideal transformer. I have understood how to use them in writing the voltage drops on the coils, but I have some doubts:

1) Which is the physical cause of their necessity? Intuitively, I think it is due to the fact that the direction of the magnetic field generated by a coil connected to a voltage source depends not only on how it is connected to it, but also on its winding sense.

2) If we write the ideal transformer equation: V2/V1 = I1/I2, do we apply the dot convention as we do for evaluating the voltage drops on the coils?

If it is true, we would write for instance:

V2/V1 = - I1 / I2

for the following scheme, since I1 flows in the dot and then in the inductor, and I2 the opposite.


texts: I have this relay from an old clock. I wanted to replace it but I can not find any replacement because I can't identify the relay type, it seems to be an odd long armature relay. Tried everything on google and on various parts supplier sites but haven't got any luck.


texts: Eagle - How to limit exported images to board layout?

texts:
I'm trying to export images of a board i made for testing purposes in order to use them for laser-cutting. I am using Eagle to create the board layout and export the images, but no matter what I do the images include areas outside the board. I am exporting the images using the command "EXPORT IMAGE image.bmp MONOCHROME 2048;". If, for example, I had a potentiometer in my board that had its shaft outside the board area, the output image would include that and therefore be much bigger than the board. I want the image output to be constrained to the board. Is there any way I can do that?

Thank you,

Riccardo


texts: Turning on/off power to NeoPixel Ring with MOSFETs from ESP12-F

texts:
I am creating a pcb with ESP12-F which will contain Neopixel Ring 12. As this will run 24/7 and Neopixel even when completely off drains about 15-20mA and I will have several of those the consumption will be pretty significant.

So I want to turn of VCC to Neopixel when not needed (which will be most of the time) so I can get the power consumption to some reasonable level.

Unfortunately, I am noob regarding MOSFETs and transistors and I did not find any specific solution, only some brief descriptions as that Neopixels should be turned on/off on VCC (so P-channel MOSFET) and not on GND (N-channel).

I found that P-channel MOSFETs are quite complicated when switched with 3V3 and probably will need to be chained with another MOSFET or transistor.

So my question is, can you please provide schematics of switch which will turn on/off the NeoPixel with GPIO on ESP (3V3 logic)? I don't want to use relays as they are pretty loud and big.

I have already implemented 3V3-5V logic converter for the NeoPixel using MOSFET (from some tutorial) and that is working like a charm (the LED1 is alternative for the NeoPixel Ring - it will either contain NeoPixel Ring or single NeoPixel Led, never both; I accidentally swapped 5V and GND labels on image):

EDIT:

I found this answer here, and it looks like what I might need, but specified MOSFETs seems a bit overkill as worst case load (which will never happen in my case) is 720mA and those MOSFETs are made for load of almost 10A. Can you please suggest better MOSFETs for 5V 720mA? At least physically smaller.

https://electronics.stackexchange.com/a/353222/209504


texts: Ned help modifying a Harbor Freight LED flashlight into a light source for a microscope

texts:
I have a couple of Harbor Freight free-when-you-buy-something-else flashlights.
 I want to modify one of them into a light source for a microscope.  I've taken (10) of the (24) white LEDs off of one of the circuit boards and resoldered the remaining (14) (most of them were really poorly soldered). The original current limiting resistor was 1.5 ohms,5% for 24 LEDs and they were powered by 3 AAA batteries.
I would like to power the remaining (14) LEDs by tapping into the USB cable used for the digital microscope I'm using.
The LED microscope has a circle of LEDs built in for looking at opaque objects, but now I've got it mounted on a traditional microscope base with an adjustable stage (this thing is cool).  I want the (14) LEDs to be mounted in the base of the microscope so it will illuminate translucent objects (traditional glass microscope slides).  My question is, what resistor value should I use to power the standard (14) white LEDs with 5V from the USB cable?
I've attached a photo of HF flashlight circuit boards, one with all the LEDs still attached and the other that I'm modifying, including sanding the tops.
I'm not real experienced with electronics. I know enough to get in trouble.


texts: Eliminating millivolt-level reverse current flow with diode or other

texts:
simulate this circuit – Schematic created using CircuitLab

I am working with PD Buddy Sink, a small USB-C PD negotiation and power breakout board. It takes USB-C PD input, performs the PD negotiation, and produces DC power. My problem is that the PD Buddy Sink does not block reverse current flow. I am attempting to use this device to charge an SLA battery. I have a SLA-05VDC-SL-A relay-based charge controller just after the sink. The problem is occurring when the relay closes and voltage from my battery bridges through the relay and into the sink's output, causing it to attempt to negotiate with the battery, resulting in a never-ending startup cycle and no resulting "forward" current flow.

I have spoken with the maker of this device and she recommended a diode. I've tried a Schottky 1N5822 and a Rectifier RL207, both of which are leaking reverse voltage on the order of about 15-20 millivolts. This is still too much for the PD Buddy Sink, resulting in the setup cycle.

Is there another solution to my problem to effectively "completely" eliminate reverse current flow from my battery/relay to the sink? I've considered a buck converter to drop the sink's 15-20 volt output to 14.x volts, but not sure if that would prevent the reverse flow I'm working against now.


texts: Why does this Op-Amp wig out when the CM voltage exceeds the spec?

texts:
While testing a MCP6H01 I came across some weird behavior when the CM voltage exceeds the operating range specified in the datasheet (VDD-2.3V Max).

This is with the op-amp configured as a unity gain follower and rails of ±3V, Both channels are 1V/div. Channel 1 (orange) is the output, and Channel 2 (purple) is the input, as you can see when the input (and common mode signal) exceeds the specified maximum, it "latches" to VDD until the CM signal drops below the spec.

What causes this to happen? Why does it show this peculiar behavior? Looking at analogous CMOS op-amps like the ADA4665-2, they have CM ranges that go to or slightly exceed the rails as you would expect.


texts: Generator synchronization to grid and angle difference

texts:
Following conditions are needed  for generation synchronization :
1 Phase Sequence
2 Voltage Magnitude
3 Frequency
4 Phase Angle
I have question about Phase angle assuming that the frequency is the same and there is a big phase angle then the phase angle will never change.
And I should wait for the phase angle to be minimal but there is a chance that this could never happen.
What happen in practice?


texts:
At work I often need a variable AC source and I usually use a large variable transformer which gives me anywhere from 1 to 300VAC. I do a lot of testing and was looking for methods to control the AC voltage level remotely. My backup plan is to use a stepper motor to physically turn the variac knob for me and control the voltage that way, but I wanted to know if there were any other methods.

I have seen SSR and TRIAC circuits that do something similar, but I want to maintain the sinusoidal shape of the AC waveform. Any suggestions?


texts: Transfer function and cut-off frequency of cascoded RC-LRC filter

texts:
At the moment I'm struggling with the problem, i can calculate the transfer function of the following circuit, but not the cut-off frequency.
The transfer function is in my case:
$$H(s)=\frac{1}{s^3\cdot (L\cdot R1 \cdot R2 \cdot C1 \cdot C2)+s^2 \cdot (L \cdot R2 \cdot C2)+s \cdot (R1 \cdot (C1+C2))+1}$$
Thanks in advance


texts: Why aren't my interrupts nested in an ATSAM controller?

texts:
The interrupt controller of an ATSAMD21 (based on a Cortex-M0+) is called NVIC (Nested Vector Interrupt controller), so I was hoping it would be easy to nest interrupts.

The documentation doesn't mention how an interrupt can interrupt another interrupt. Actually, it doesn't say much about the interrupts, as they don't even have their registers listed, being only mentioned under the chapter "Processor and Architecture", unlike other peripherals which have their own chapters.

Searching the headers and the debugger I found the following registers used by the interrupt controller:

enable register. Every one of 28 possible interrupts has a bit here.
pending register. same as above
priority register.

Setting an interrupt to be of higher priority than another one, still doesn't allow it to interrupt the lower priority one.

The application notes about interrupts don't mention any way of nesting interrupts, it is rather written that:

  Inside an ISR, interrupts are disabled. Therefore don’t do anything
  that requires an interrupt to be serviced.

EDIT : Thanks to pointing me to the ARM documentation, where it is stated that higher priority interrupts always preempt lower priority interrupts.
However, some experiments show that it either does not happen on my board, or it takes too long.

Experimental setup

The links to this question showed statements that interrupt nesting is not only possible, but actually the only option for Cortex-M0 processors. Still, my experiments show otherwise.

In a timer overflow interrupt, the first thing I do is to check the value of the timer, thereby getting the interrupt latency (+ the few clocks required to read the timer). I calculate the maximum of this latency over the period of at least one minute.

If I only have this timer running, I have times below 1.5 µs
If I start several SPI senders (SERCOM), all transmitting continuously (all they do in their transmit interrupt is to fetch the next byte), I measure 4.2 µs
If I put a deliberate time wasting code (a few floating point operations) into two of the SERCOM transmit interrupts, I measure 140 µs!
If I put the timer interrupt to priority 0 (the highest) and all SERCOMs to priority 3, I measure 70 µs! Half of the time that I measured when all the interrupts had the same priority. This also seems to show that the SERCOM interrupt was never interrupted by the timer interrupt.
If I double the floating point operations in the SERCOM interrupts, the worst case latency in the timer interrupt is almost 140 µs, which would indicate that they are not interrupted.
If I put an endless loop after the float operations, the time is still 140 µs, so the endless loop does get interrupted. (And it was not optimized away - if I set all interrupt priorities back to the same value, it gets stuck in the endless loop)

EDIT My mistake was that although I set the priorities to the SERCOM interrupts, I didn't set it to all of them. SERCOM interrupt priorities have to be set individually. Closing the question, as I think it deviated too much from its original concept to have this posted as an answer.


texts: What is happening with resistors series paralel in base of a bjt

texts: The R1 receives 5 volts from the arduino, but with a low current, so the BJT is used to amplify the current, but every example I have seen of this, does not have the R2 in that way, what is the R2 doing here?


texts: Keep individual LED brightness steady when other LEDs are added or removed

texts:
I'd like to use several LEDs on a project, with brightness control (it's a scale model of a street with houses, with LEDs of different brightness in each house, which I've been working on with my son). However, I'd want the brightness of the LEDs not to change when I turn some of them on and off (or equivalently, if I add or remove LEDs).

I know I can control dimness of LEDs either by directly varying the current applied to them as in this project from someone else or by using PWM as suggested here -- but in both cases (I implemented the two projects listed above as a test), the current source is the same so their brightness will vary depending on the number of connected LEDs (which make sense, since the full LED set is plugged on a single transistor's collector).

What would be the simplest way to achieve what I'd want in this case? I'd rather avoid using, for example, an Arduino (would be too physically large and would involve programming -- I'd like this to be as simple, small, cheap as possible, without microcontrollers). Is there some simple way to decouple each LED from the others, and still have central control of their brightness?

Connecting the LEDs in serial would not be good either, since I would not be able to remove those in the middle (and this would require a too high voltage to work, because of the accumulated voltage drop of the LED string).

Thank you!


texts: For an opamp configured as a unity-gain buffer, should its output DC level follow input DC level?

texts:
In an opamp configurated as a unity-gain buffer, output voltage amplitude and input voltage amplitude should ideally be equal. However should the output DC level be equal to input DC level as well?
Here is the configuration of the unity-gain buffer.

source: http://www.learningaboutelectronics.com/Articles/Unity-gain-buffer


texts: MCP3008 (ADC with SPI interface) what to do with unused pins?

texts:
I'm building embedded system based on a Raspberry Pi with an MCP3008 for analog inputs. I have few questions regarding the PCB board design.

What should I do with unused analog inputs on my MCP3008?
What other countermeasures I can use for minimizing the analog noise jeopardizing my ADC measurements? I don't want to use analog ground because that requires another supply circuit for ADC board and I want to power up the MCP3008 directly from my Raspberry Pi.
Any other advice?

For now I'm working with a prototype on a breadboard. The wires are long and unused ADC inputs are not connected to a ground. I can see quite a large amount of noise from time to time on my analog readings and I want to come up with good enough countermeasures in my final project in order to minimize noise observed on my prototype.

Final Project Results:
http://maqister.blogspot.com/2016/08/my-homemade-raspberry-pi-expansions.html


texts: normal and reverse pulses from single push-button

texts:
The following would be to use instead of a spring-to-centre toggle switch (which I don't like).
I would like (if at all possible) to use a single push-button, which when pressed will send a short forward(?) pulse, and when pressed again will send a short reverse(?) pulse.
This would be either by the push-button having 3 (or more?) pins for common(?), A(?), and B(?), so that alternate presses would send forward/reverse pulses;
OR,
it having only 2 pins, which would send a pulse to some sort of intermediate component/circuit, which in turn would send forward/reverse pulses downstream on alternate pulses from the push-button.
Is such an idea possible, and if so, what other components would I require.
Thanks.


texts: Nodal voltage magnitude properties of electricity distribution networks

texts:
I am wondering how to know about an electric bus according to its measured voltage magnitudes (possibly and its corresponding real power injection profile).
Following assumptions can be made:

One three-phase-four-wire low-voltage radial power distribution network with laterals.
Residential load only.
There is no transformer or voltage regulator (because I heard they were not common).
We know the phase of measurements. But most likely, we only have those for one phase. We have measurements from different phases.
We may have real power injections (same phase, same bus) at the same time.
We may have measurements from multiple buses with same time indices.

Then, if I give you some nodal measurements from some buses in the same phase, can you derive some information on these buses? The bus must show some characteristics because of its "position" in a radial electrical network.

Sept 1, 2020: I found a concept called V/V0 index: assuming the bus voltage values (V) to be known from load flow or state estimation studies, new bus voltages (V0) are obtained solving a load flow for the system at an identical state but with all loads set to zero. The ratio V/Vo at each node yields a voltage stability map of the system, allowing for immediate detection of weak and effective countermeasure spots.
But there is no way for me to obtain load flow results, because I only have nodal measurements.

Sept 2, 2020: I found voltage magnitudes of a bus is larger than those of buses further away from the root, if there is no capacitor. For example bus 645 is closer to the root compared to bus 646 in the following IEEE-1992-13 case.

Right now, I can think of one method to group buses. If I regress voltage magnitudes on real power injections, I have a slope, indicating how much effect real power have on the nodal voltage:

Then, if we have slopes from the same phase of two buses and slopes are really close, then we know they are most likely in the same branch. In IEEE-1992-13 test case, I got following results for one phase:
632 11.819768711285295
670 11.820047039778458
671 11.821094186322632

633 11169.153693797027
634 1288.7489820261399

684 4460.569650713787
652 4508.958261689517

680 248273082537576.5

692 11.822712103994313
675 11.827380543736016

In my setting, we don't know the name of the bus. But based on the statistics, we can say 680 is not in the main branch, 684 and 652 are close to each other, etc.


texts:
How can I do my own sub ckt for SPICE. I want to design a potentiometer(for eg). Assuming it in the form of a block model - it will have 3 pins - 2 pins for the resistor and 1 pin for the centre tap that can vary the resistor value. If I warite a subckt, how do I proceed with it please ?
Is there any suitable tutorial ?
Also, for eg - I would like to design a subckt for a variable resistor.This is time based(at time t0 it has a specific value,t1 it has specific value and so on and so forth). I have a formula for it. How can I implement this formula sub-ckt ?
I am look at the syntax for this please.


texts: How does the center tap terminal work in Knowles Speakers ED series?

texts:
I would like to understand how the center tap terminal work in miniature speakers. I can see in the datasheet that a positive going voltage relative to this center tap can lower the output volume but it does not specify by how much?

How can I calculate that?
How is the actual connection between the 3 pads?

Maybe it is just a parallel connection between the positive pad - the center tap terminal and half the speaker resistance. I just want to be sure of this.

Thanks for your help.


texts: Resistor Network with voltage source and current source

texts:
Can i get some help on solving this circuit please? I need to calculate the output voltage Vout, but im not sure what to do when i have a current source parallel to R2.

What i tried doing is putting Vs as short circuit and dividing parallel resistor R2 by R1+R2 and multiplying by the current I1 of the current source.


texts: Passing USB signal over short SATA cable and connector

texts:
I am working on a prototype device and I will have a daughter-board mounted at an odd angle in a custom enclosure. I need to get a USB signal, and a few extra GPIO type wires, over to the board. I can't really do a board-to-board connector and will almost certainly need a cable. It only needs to run a few inches, about 2-4. It needs to be reliable and easy to assemble, no stripping an existing fine wires. I don't want an actual USB connector, I'm looking for something slightly more permanent.

I had a few thoughts and am not sure what is best.

Use a ribbon cable and IDC connector. Noise might be a problem but I'm not sure. I could wrap with a foil tape, but it's still not a twisted pair and might be slower.
Use a shielded USB cable that is terminated with a female crimp header, like you see on a motherboard for front panel USB. This seems like a good option, but I can't find a source of really short cables. It also wouldn't have the extra connections.
Use a SATA connector and cable. It's well shielded and readily available. It's not twisted pair though. Will that be a big deal over a few inches? How terrible is it to use a standardized cable for something completely different?

Open to suggestions and corrections.


texts: 1-wire parasitically powered microcontroller?

texts:
I've seen Dallas' 1-wire sensors, they look great. But, I'd like to make some custom 1-wire slaves which can be parasitically powered (just ground + data).

Can anyone recommend a low power microcontroller which is suitable for this?

Does anyone have a sample circuit for how I would power an MCU from the 1-wire bus?


texts: Would I need a zero-crossing SSR for a reflow oven controller?

texts:
I'd like to follow this guide to create a reflow oven controller: https://apollo.open-resource.org/mission:resources:picoreflow

But I am confused on the zero-crossing SSR.

Does it need to be zero-crossing to control the heating element?

I already have a very old SSR for which there isn't even a data sheet, so I am unable to tell whether it has zero-crossing.


texts: What does "normalized" mean in this datasheet?

texts:
I came across the graph below in ONSemi's 2N3904 datasheet that depicts the DC current gain.

I don't understand what "normalized" means. I've read other explanations by Googling, but found all of them to be more vague than helpful.  Please explain what "normalized" means in this context, and why they would use it in place of the DC gain numbers?


texts: How to determine maximum switching frequency of power modules?

texts:
Power IGBT and MOSFET modules give some datasheet values that look like they could be used to calculate a maximum frequency, but I'm not sure how to interpret them to do so.

The datasheets generally have four timing parameters: turn-on delay time \$T_{D,on}\$, rise time \$T_r\$, turn-off delay time \$T_{D,off}\$, and fall time \$T_f\$. My first guess is that the minimum switching period would be simply \$T_{D,on} + T_r + T_{D,off} + T_f\$.

Just adding all these together can't be right, though, since for an IGBT module that I'm considering using for a project it produces a max switching frequency of over 2 MHz, far above anything I at least would consider feasible. Running this module at 2MHz would result in switching losses that exceed its maximum power dissipation by two orders of magnitude! Is the switching frequency instead limited solely by power and thermal considerations?


texts: Trying to make a circuit for a 3D printed lamp

texts: I am trying to figure out a circuit for my 3D printed lamp. I am trying to use a 9V battery to power a 3.2V through hole LED. Would you suggest a buck converter or a switching voltage regulator?


texts: What's the easiest way to implement portable current measurement for a ~200W dc motor?

texts:
I'm tinkering with an electronic skateboard build and I'm looking for a way to do some current measurements "on-the-go". What's the easiest way to implement this?

It wouldn't be a part of the final design, I'm just trying to collect real-world power data for my second board revision.

Basically, I'm looking for something like this DIY power meter/logger (pictured below) but for higher currents (up to ~20A to be safe).

Would something like SparkFun's split core current transformer (pictured below) combined with a battery powered Arduino work?


texts:
I have multiple temperature sensor connected to microcontroller PIC16F887. How can I assign single PIN to a variable? Is it possible?

unsigned char  Check, T_byte1, T_byte2, RH_byte1, RH_byte2, Ch1;
unsigned Temp, RH, Sum;
unsigned int Temperature, Humidity;
unsigned char TH;

void SelectSensor(int sensor){
    if(sensor == 1)
        TH = RA0;
    else if(sensor == 2)
        TH = RA1;
    else
        TH = RA2;
}

void StartSignal()
{
    TH = 0;
    __delay_ms(18);
    TH = 1;
   __delay_us(30);
}

void CheckResponse()
{
    Check = 0;
    __delay_us(40);
    if (TH == 0)
    {
        __delay_us(80);//80
        if (TH == 1){
            Check = 1;
        }
        __delay_us(40);
    }
}

///////////////////////////////////////////////////////////////////////////////////////////////////////

char ReadData(){
     char i=0, j;
     for(j = 0; j < 8; j++){
         while(!TH );               //Wait until TH1 goes HIGH
         __delay_us(30);
         if(TH == 0)
             i&= ~(1<<(7 - j));     //Clear bit (7-b)
         else {
            i|= (1 << (7 - j));     //Set bit (7-b)
            while(TH1);             //Wait until TH1 goes LOW
        }
    }
    return i;
}

void calculateSignal(){
    StartSignal();
    CheckResponse();
    if(Check == 1){
        RH_byte1 = ReadData();
        RH_byte2 = ReadData();
        T_byte1 = ReadData();
        T_byte2 = ReadData();
        Sum = ReadData();
        if(Sum == ((RH_byte1+RH_byte2+T_byte1+T_byte2) & 0XFF)){
            Temp = T_byte1;
            Temp = (Temp << 8) | T_byte2;
            RH = RH_byte1;
            RH = (RH << 8) | RH_byte2;
            if (Temp > 0X8000){
                Temp = Temp & 0X7FFF;
            }
            Temperature = Temp;
            Humidity = RH;
        }
        else{
            //lcd_clear();
            //printf("ceksum error");
        }
    }
    else {
        //printf("no response");;
    }
}

int getTemp(){
    return Temperature;
}

int getHumid(){
    return Humidity;
}


texts:
Altium Designer exports Pick-n-Place coordinates for a micro USB-B connector as geometric center of signal layers (top and bottom) area (other layers do not affect the coordinates) (a yellow mark on the picture). But the actual coordinates of the center of the connector are different (a blue mark on the picture). Should I fix the coordinates manually after export from Altium or this is correct coordinates, and a manufacturer will figure it out.

Also, which orientation is considered as zero orientation for the micro USB-B connector? I just copy footprint from datasheets (where the connector looks down), but in the tape/reel he looks to the right. So I'm nor sure which orientation is zero-orientation.


texts: Developing an embedded system; from arduino to microcontroller?

texts:
Can I develop an embedded system; starting with prototyping by using an arduino board. Then extract the hex code that I verified on the arduino board and load it on to a microcontroller. (Of course the target controller must be the same as the one on the board).

It comes to me as a sensible approach, may be this is the way that everyone follows.
I want to learn if it is plausible or nonsense? Any cons and pros.

Thanks


texts: how does this circuit protect against short circuit

texts:
I am reading the datasheet for the of the P82B96 an i2c extender and the datasheet recommended a circuit that protects the i2c master against short circuit.
On Figure 14.

I have boxed the circuit part in question but i am not able to grasp how it protects it. The circuit almost looks like a constant current circuit.
A typical circuit looks like this without protection

On the protected version SCL RX is now tied to V+  instead of shorted to TX does this mean the slave cannot initiate the transaction now (assuming the slave is also an mCU).
Can anyone help explain to me what is happening on the short circuit protection?


texts: How to connect four different ground planes in the same PCB?

texts:
I am working on a project which uses the LTC4020 multi-chemistry battery charger from Linear Technology. The design includes a microcontroller ( NXP KL25Z) to provide additional outputs and communication capabilities.

The LTC4020 must be connected to SGND (signal ground) and PGND (power ground), both planes must be connected at a single point to follow the star ground philosophy. In the DC2044A demonstration circuit this connection is made directly under the IC as shown in the image below, so I tried to follow this approach in my PCB.

The microcontroller has separate pins for analog and digital grounds (AGND and DGND), so we have a total of four grounds in the design (SGND, PGND, AGND and DGND). I think we can treat SGND and AGND the same, but I am not so sure about what to do with the remaining grounds.

In the article "Staying well grounded" from Analog Devices, the author suggests that the analog ground must be used as the return path for the analog and digital circuitry in mixed-signal devices, provided that the return currents from the digital section are not too high. Unfortunately, I do not believe this is the case with the microcontroller.

On the one hand I wouldn't like to use the AGND/SGND plane as the return path for the digital circuitry of the microcontroller because the fast switching transients may inject some noise in the analog section, but on the other hand using three different ground planes might not be a good idea.

Is using three different ground planes the best approach in this application?

What is the best strategy to connect these three ground planes?

Thanks in advance.


texts:
There is a question here about something similar, but it's asking about the internals of an op-amp. I'm having trouble understanding the function and use despite several hours of YouTube tutorials.

simulate this circuit – Schematic created using CircuitLab

I'm having an awful time figuring out how this works...and EXACTLY what it does.

From what I understand:

1) Op-Amps compare the voltage between the non-inverting input and the inverting input, then multiply the difference by an almost infinite number and that product becomes the output. (I.E. Gain)
2) The inputs neither draw nor output any current.

This configuration should make it so that the inputs are always at the same voltage.

I'm not sure I understand the purpose of this configuration, and I certainly don't understand how negative feedback works to produce that effect on the inputs.


texts: What prevents the lead attached to a semiconductor from forming Shottky junction

texts: What prevents lead attached to a piece of semiconductor (for example in BJTs and FETs) from forming a Shottky junction?


texts: Are these equations correct? (transfer function)

texts:
I have a given transfer function \$ |H| = \frac{R_2}{\sqrt{R_1^2+\frac{1}{(\omega c)^2}}} \$
 where \$ c = 1\mathrm{\mu F} \$ and \$ R_1,R_2 \$ are unknown.
I know that \$ |H(j\omega_c)| = 50.1 \$ where
\$ \omega_c = 500\mathrm{ rad/s} \$ and that the gain decreases with 20dB/decade for \$\omega<\omega_c\$. The way I've understood the 20dB/decade decrease is that for \$\omega=50\mathrm{rad/s}\$ we should have
\$|H|_{dB}=14 \implies |H|=5.012\$ since
 \$50.1\approx 34\mathrm{dB}\$. By that reasoning I get the following two equations

$$
\frac{R_2}{\sqrt{R_1^2+\frac{1}{(500c)^2}}}=50.1\
$$
and
$$
\frac{R_2}{\sqrt{R_1^2+\frac{1}{(50c)^2}}}=5.012\
$$

But they don't give me the right answers, what is wrong with this reasoning?

Here is the schematic


texts: Boost or buck regulator for battery life?

texts:
I want to make a wireless sensor node that will run at about 2.5v. I am trying to decide between running 3 alkaline batteries in series with a buck converter or in parallel with a boost converter. I guess if both converters have the same efficiency, let's say 88%, they would run just as long as each other?

The current required for this project should be <200mA


texts: Damaging a linear regulator applying a voltage to the output

texts:
As a simple project, I was trying to replicate an Arduino Nano, fabricating my own board. I'm using a UA78M05 linear regulator to feed 5V from a 9V battery (see image below) as external power supply.

simulate this circuit – Schematic created using CircuitLab

Now, this board uses an 6-pin IDC type connector for SPI programming. Since the 2nd and 6th pins of the IDC connector are, respectively, Vcc and GND, I'm applying a voltage to the output of the linear regulator. The problem is that the regulator immediately heat up (after maybe 10 seconds I can't touch it). Is it supposed to heat up like this and I simply forgot to put a heatsink? Or is there something wrong with the wiring? The rest of the board follows in the next image. All the parts were soldered by me and are SMDs on a board professionally frabicated (no home-made etching).

Edit 1: Following the suggestion of Dwayne, I hooked up a 1N4007 diode across the output and input pins. The result was that now the heat distributes across the two components: for the same amount of time during which I keep the battery connected (or the IDC connector), if there's the diode, the regulator will heat less but touching the diode you can feel it heated. Is this an expected behaviour or there's something wrong with wiring/power dissipation?


texts: Safe Powering Methods - Working with Children

texts:
I'm carrying out a research project this year at uni, which will include creating small electronic sensory devices for children (under 7) with autism. Obviously, safety has to be taken very seriously.

Only relatively small amounts of current will be used - probably powering simple sensors on an Arduino board - but seeing as my knowledge of all things electronic is pretty limited, I thought I'd try and get some suggestions first.

From the research I've done, I found PoE at littlebird: http://littlebirdelectronics.com/collections/freetronics/products/4-channel-power-over-ethernet-midspan-injector - which looks like a pretty good solution, seeing as I want the ability to control the device remotely, over a local network. A benefit also being that I can keep the number of wires poking out of the device to a minimum and also not have a direct lead going to a wall socket.

So far, I'm really only at the stage of planning the 'core' of these devices, which would be an Arduino board with limited sensors attached, possibly using the internal parts from a Wii remote. Because I don't yet have confirmed participants, I don't know exactly what sensory needs I'll be working with (each autistic child will have specific sensory issues) and therefore exactly how much power I will need for the devices. I will aim to keep it at a minimum though, simply for safety reasons.


texts:
I don't understand how to calculate the voltage that should enter the inverting terminal of the amplifier[V-]
Could you help me to find out how this circuit works and why the output, when Vin is zero, will be 1.6V?

Note that \$R_1\$ and \$R_2\$ are a simple voltage divider, so we could remove those resistors to keep the circuit simple.

$$R_3 = 1\text{k}\Omega$$

$$R_4 = 3\text{k}\Omega$$

$$R_5 = 1.5\text{k}\Omega$$

CV+ (Positive supply voltage of the op amp) = +5V

CV- (Negative supply voltage of the op amp) = -5V


texts: How is memory stored in a computer? Is it 1 bit per address so in order to get the value of an integer (32 bits) it must go through 32 addresses, get all the bits of 0's and 1's? I am a bit confused since I am reading a book on computer organization and architecture but the author does a poor job explaining thoroughly. Because what is really confusing me is when book uses examples and states 16 bit word of memory for an instruction. How is a word stored in memory? For this situation would it be 16 sequential addresses?