I have been using a mechanical SPST relay through a transistor without a fly-back diode (I know bad form), but because I am trying to have a consistent on and off state of the relay I have found that the only way to do so is not using a diode.
Is it advisable to swap out the mechanical relay for an SSD relay and would there be any issues with doing that? My current issue with the schematic is that I think the transistor fails due to current back-flow.
The wiring diagram for how I have everything wired so far is below:
As drawn your circuit will not do anything. The relay coil will never energize. You have relay coil pin 8 connected to GND and you have relay coil pin 5 being switched to GND through your transistor. The relay coil has no path to Vcc?
Next you should be using a flyback diode.
The use of a flyback diode will have nothing to do with On/Off timing of the relay.
You are dhowing an Arduino with 12 VDC applied to the chip? I assume you have the Arduino Uno R3 board not as drawn.
Yes, the transistor likely fails as a result of inductive kick when the relay coil field collapses when the coil current is removed which is exactly why flyback diodes are required.
Sorry I just realized that this diagram is not drawn as the actual device is in reality. The relay is connected through the 8 pin to the +5V, this diagram is an older version which is incorrect.
Yes 12 VDC are being applied to the chip and it is an Arduino Uno R3 chip. Is there better software for designing these diagrams, I used kicad to generate this.
I used a 1N4148 diode as a flyback diode in the past amazon ASIN #: B06XB1R2NK and I noticed that it activated my circuitry controlled by the relay differently than without it. I need the device to have highly consistent timing - is an SSD relay more appropriate here?
As in the relay is in the closed state for an exact or as close to exact period of time. Any one button press should only differ in the activation time of the relay by around .2-.3 seconds. I was able to achieve this without using a diode but by activating the transistor but I have been needing to replace the transistor more frequently than I would like because of the set-up.
// These constants won't change:
const int RelayPulsePin = 12; // pin used to bias the transistor for pulse waveform (built in LED on board shows when this is toggled)
const int buttonPin = 7; // pin that the momentary switch is attached to
void setup() {
// set up the LED pins, one is for power to system while the other is for the pulse:
pinMode(RelayPulsePin, OUTPUT);
pinMode(buttonPin, INPUT_PULLUP);
digitalWrite(RelayPulsePin, LOW);
}
// while button is pressed, write the HIGH signal to RelayPulsePin (pin #12 on Arduino), keep HIGH for 250 msec, then write LOW; wait for 1 second, and then go back
void loop() {
// Monitor pin #7, which is connected to the pushbutton switch
if (digitalRead(buttonPin) == LOW) {
digitalWrite(RelayPulsePin, HIGH);
delay(250);
digitalWrite(RelayPulsePin, LOW);
delay(2000);
}
}
The below is what I am concerned about - this is from wikipedia, but I have seen it in a number of other sources as well.
When the inductive load is a relay, the flyback diode can noticeably delay the release of the relay by keeping the coil current flowing longer. A resistor in series with the diode will make the circulating current decay faster at the drawback of an increased reverse voltage. A zener diode in series but with reverse polarity with regard to the flyback diode has the same properties, albeit with a fixed reverse voltage increase. Both the transistor voltages and the resistor or zener diode power ratings should be checked in this case.
True, a couple of milliseconds delay can be expected. That is not at all a problem, as it is a constant, and you can always adjust the on/off timing in the code.
Please post a picture of an accurate, hand drawn schematic diagram, with pins and connections clearly labeled. Pencil and paper work very well for this.
No you have an Arduino UNO R3 which is a board, The chip is a a microcontroller board based on the ATmega328P ... You apply 12 VDC to the chip and he chip is toast. You have a board and the board has a voltage regulator on it.
Next a common 1N4002 diode will do just fine. Just about any 1N4000 series diode will do just fine but you need a flyback diode.
Things go better when an accurate schematic and code are posted.
Below is the accurate schematic within my region of interest. I am using this to activate a piezoactuator and the original design which I have based my current work off had some major design issues such as driving the 36 mA relay through a digital pin.
Of note, I am using the same Arduino board after having used the original design significantly - is it likely that this board is just already fried?
You should NOT use the 5V output of the Arduino to power a relay, motor or servo. The onboard voltage regulator will overheat and shut down. That is very likely the root of the timing problems.
The 5V output is intended for nothing more than an LED or very low power sensor. Use a separate power supply for the relay (don't forget to connect all the grounds) and use a diode to protect the transistor.
The relay pins 2 and 4 are getting current from a buck converter which is itself supplied by a universal AC adapter that has 12V 30W. There is a potentiometer on the buck converter that is changing the voltage the relay is running through its switch from 1.2V up to around 4.5V.
The schematic in #12 is correct, I am talking about what is running through relay pins 2 and 4, not the relay inductor connected to 8 and 5. I thought this was what was important about the voltage it is controlling for a SSR.
If you are switching an AC load yes, you can use an AC SSR or if a DC load a DC SSR. Using a SSR the voltage to turn it On/Off is known as the control voltage. Typically the control voltage is 3 to 32 VDC. The SSR also has its limits so I suggest you read up on types of SSRs. You choose a SSR based on the intended application, things like load current and control voltage and be it an AC load or a DC load. We have no idea what your load is or what you are switching.
As to your relay in post 12. You have pins 2&4 reflecting a short less any contacts. You are also still leaving out a flyback diode.
Yes, but what @jremington says, is the schematic shows you're driving the relay inductor using 5V pin from Arduino!
So, IMHO if the schematic is correct this means that's a severe issue to be fixed, if not correct you're just making confusion to people trying to help you, thus keep wasting our time (and don't get a good solution).