ESP8266EX integrates Tensilica L106 32-bit micro controller (MCU) and ultra-low-power 16-bit RSIC.
And if a diode fails ... in most cases it fails "short circuit".
And if a bjt fails due to overvoltage .. it fails as "short circuit in CE"
Consult the experts, the rel departments of your fav vendors. I am not a rel expert of all possible applications/failures,I would be happy to hear how often a relay diode failed in a properly designed circuit
Costwise: One has to spent a lot of money for the optocoupler, the resistor, assembling, the repair of the opto-coupler-fails and the assembling fails.
Thank you for replies,here I used relay to switch ac load like electrical school bell.in my experience if I didn't use optocoupler then at the time of ringing of alarm bell then sometimes controller stops or hang.if I use solid state relay then it works without any error . But solid state relay is too costly then magnetic relay.and when anyone ring electrical bell manually then ssr will damage.
Thank you for replies,here I used relay to switch ac load like electrical school bell.in my experience if I didn't use optocoupler then at the time of ringing of alarm bell then sometimes controller stops or hang.if I use solid state relay then it works without any error . But solid state relay is too costly then magnetic relay.and when anyone ring electrical bell manually then ssr will damage.
/************************************************************/
// save a floating point value to EEPROM
void EE_SaveFloat(int BaseAddress, int EEoffset, float FloatValue)
{
union EE_float
{
float FloatVal;
byte EEBytes[4];
};
EE_float FloatBytes;
FloatBytes.FloatVal = FloatValue;
EEaddress = BaseAddress + (EEoffset * 4); // to save calculating address offsets in main code
ee.writeByte(EEaddress,FloatBytes.EEBytes[3]);
ee.writeByte(EEaddress+1,FloatBytes.EEBytes[2]);
ee.writeByte(EEaddress+2,FloatBytes.EEBytes[1]);
ee.writeByte(EEaddress+3,FloatBytes.EEBytes[0]);
delay(6);
}
/************************************************************/
// retrieve a floating point number from EEPROM
float EE_GetFloat(int BaseAddress, int EEoffset)
{
union EE_float
{
float FloatVal;
byte EEBytes[4];
};
EE_float FloatBytes;
EEaddress = BaseAddress + (EEoffset * 4); // to save calculating address offsets in main code
FloatBytes.EEBytes[3] = ee.readByte(EEaddress);
FloatBytes.EEBytes[2] = ee.readByte(EEaddress+1);
FloatBytes.EEBytes[1] = ee.readByte(EEaddress+2);
FloatBytes.EEBytes[0] = ee.readByte(EEaddress+3);
return FloatBytes.FloatVal;
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?