Hot answers tagged

11

There are three things you can do: Remove the bootloader entirely and program the board with a hardware programmer (USB-ASP, Another Arduino, etc). Edit the bootloader source, recompile, and reinstall it to the board using a hardware programmer (as in option 1). Just don't use pin 13 for the relay. Of the three options the third one is by far the simplest.


8

Transistors are solid state switchers, that is, they don't have any moving parts. MOSFETS are like transistors, but are rated for higher voltages. Relays are more expensive, but they have moving parts. Transistors and MOSFETS produce a lot of heat. They have 3 pins (usually) called the base, emitter, and collector. More info here Relays use a magnet to ...


8

Processor pins have strictly limited current drive capability. The rated values may vary depending on whether you want a high or low drive. Some processors will supply only a few mA and the most you will usually officially get is in the 20 to 30 mA range. There is usually a total current limit for the processor and only a few pins can provide peak ...


8

You should put a resistor in series with the led to limit the current. The IO pins cannot source enough current to run the pump without damaging themselves. That's why you need a buffer of some kind. The extra components in the relay module are a transistor to do the actual switching and a reverse-biased flyback schottky diode in parallel with the relay ...


7

The recommended output (source or sink) from an I/O pin is 20 mA. The absolute maximum is 40 mA. Your relay coil is likely to consume more than that, particularly when it initially energizes. This will damage your output pin. Then it will eventually fail. Nothing seems to be amiss by far. No, not yet. :) How can one control such components without ...


7

I have several of these modules. They have an optional opto-isolator built-in, but you have to remove the jumper to use it. Connect your GPIO trigger as you have it Run the relay's Vcc and Gnd pins to the MCU, not the power plug. connect the power plug's +5v to the left-most pin, where the jumper once stood: JDVcc connect the power plug ground to the MCU or ...


6

You need to join the ground of the external supply to the ground being supplied from the Arduino. The 12V supply must be capable of at least 100ma There appears to be a transistor and resistor on the board. This is probably to drive the relay coil from the Arduino. However, I would need to look at the circuit diagram of the board to be certain. Can you ...


6

The PowerSwitch Tail 2 is a great way for experimenters to control mains voltages. It is insulated and internally decoupled, so you only have to hook up 5v, gnd, and a signal line to control it. This model supports only 120V, but there are also kits for 230V. image from sparkfun


6

The voltage will be fine - as long as you plug it into the DC barrel jack, and don't try to wire directly to the 5V pins. The barrel jack has a voltage regulator on it that will convert 7-12V down to the required 5V. But there's a second reading that you need to look at, not just voltage. The 9V adapter will also have a current rating expressed in milliamps ...


6

You need to implement hysteresis. Set two temperature points around set_temp. One a little higher to be a limit for turning the heater off and a one a little lower then set_temp to turn the heater on. You only need to change your if else condition a little if (current_temp < set_temp - HYST_VALUE) { digitalWrite(ssr_u, HIGH); } else if (current_temp &...


5

The digital output pin cannot output sufficient current to drive the relay directly. Iirc this question was already asked. You need to add between the Arduino and the relay a driving stage, for example with a FET. Or you can use a shield that already has this additional circuitry. Just google for "Arduino relay driver circuit" and you will get various ...


5

One approach would be use of a DS3231 (Precision Real Time Clock) module. Such modules sell on Ebay for under $1. Search for ds3231 arduino. Typically, these modules have a six-pin connector, with pins labeled 32K, SQW, SCL, SDA, VCC, and GND. As noted in DS3231 specs, the INT/SQW pin is used either for square-wave output or for interrupt output. On ...


4

Big differences between relays and transistors are: relays are all-or-nothing (like switches) whereas transistors can transmit more or less current through the collector based on the current present on their base. relays provide isolation between the command circuit (the one with the electromagnet) and the controlled circuit (the one on the switch side of ...


4

The good advice to people asking how to drive a relay to control mains voltage is: don't. Start with a complete solution such as those from PowerswitchTail.com and sold by many places: Powerswitch Tail You can get these already built or in kit form. The 20 $ price is small price compared to damage to people or home you might incur with a home built ...


4

You are attempting to use IO pins that are already in use by the MP3 shield. According to your subsequent research, only digital pins 0,1,5, and 10 are available for use. You should shy away from using pins 0 and 1 since they are also connected to the computer through the USB interface and are used for uploading sketches. You will find that either you can'...


4

Have a look at the simple circuit on this PDF from the Arduino Playground. It shows a single transistor to drive a small relay. As Russell says in his answer, a ULN2803 or similar is a chip which will allow you to drive several small relays, which is neater than using several transistors, if that's what you want. (Also note the diode "D1" in the circuit I ...


4

That isn't just a relay you are linking to. That's an entire board that, among others, contains a relay (blue box). This board already has a transistor to drive the coil inside the relay. It also has a diode to handle back EMF. It even has a opto-coupler, thought that isn't that useful as in most cases both sides of the opto-coupler are powered by the same ...


4

To control AC power for inductive load (motor) a Triac is used. The concept is called phase cutting. It works for a resistive load (heater) too. This module is designed for phase cutting. It contains a zero crossing detector and a Triac. The control is done in MCU. The zero crossing detector is wired to an interrupt pin. The control signal for the Triac is ...


3

All the relay boards I've come across are 'active low' i.e. as you've discovered bringing the control pin down to earth activates the relay. As an aside just be careful that the arduino has enough juice to power the relays, a separate supply is normally required if these are coil rather than ssr type relays


3

I think one of the best way for you would be to use 74HC595 chip. You will learn a lot while developing board with this chip. It is well documented Serial to Parallel Shifting-Out with a 74HC595. Using 3 pins you will be able to turn on & off as many LED's as you wish, use external power supply and so on. Also there is MAX7219 chip. The MAX7219 and ...


3

Caveat: I too am new to this. The answer below is my understanding and I need an expert to confirm. Current in your Arduino: A single digital pin on a Uno will provide 40mA -- and could conceivably power two of your LEDs. The VCC pin outputs 200mA and could therefore conceivably power ten. So all you need to do is power your LEDs from your VCC, but use ...


3

Try this: void setup () { pinMode(0,OUTPUT); //IB1 pinMode(1,OUTPUT); //IA1 // pinMode(2,OUTPUT); //IB2 // pinMode(3,OUTPUT); //IA2 pinMode(4,OUTPUT); //RGB red pinMode(5,OUTPUT); //RGB green pinMode(6,OUTPUT); //RGB blue boolean motorOn = false; } void loop () { digitalWrite(0,motorOn); if(motorOn) { digitalWrite(4,HIGH); // red on ...


3

To really protect your arduino it's worth putting a photo-coupler on the pin and driving your circuit that way. Then no stray inductive charge or short can affect the arduino. They are also called OptoIsolators or Optocouplers. http://forum.arduino.cc/index.php?topic=143954.0


3

Let us look as some basic's, these seem to be the basis of a lot of questions: A capacitor when power is switched on draws a huge amount of current that tapers off as it gets charged. This curve is also called the RC time constant (this is close but not exact "http://www.electronics-tutorials.ws/rc/rc_1.html" will give a better explanation). When ...


3

So according to your comments this should be the code if no mistake was made #include <IRremote.h> #define irPin 8 IRrecv irrecv(irPin); decode_results results; const int buttonPin = 2; const int relay1 = 13; const int relay2 = 12; int relay1State = 0; int relay2State = 0; int masterState = 0; int buttonState; int lastButtonState; long ...


3

I don't want to try anything that results in a fire hazard. That's a good idea. Besides those toy relays there are real ones: 440 V AC * 63 A (Around there, you can find smaller ones too) BTW: Don't rely on what's printed on the relay itself, with cheap Arduino relay modules. 230V and some current need proper handling by the PCB board as well (size and ...


3

Would a non-blocking timer solution work? Yes. Your "timer" doesn't have to be anything more than a start time from millis() and a flag. Then your loop just compares the start time to the current millis() value, and if it's more than the interval you wanted, do the "thing". In code: uint32_t startTime; bool waiting = false; const uint32_t PUMP_DURATION =...


3

The "blink-without-delay"-pattern shows how this can be solved but with several time periods and logic this becomes complex. Some abstraction is needed. The Timemark library provides a solution. Belows is the logic for a single sensor-relay pair with a state trace to serial: #include <Timemark.h> const uint32_t TURN_OFF_TIMEOUT = 30000L; Timemark ...


3

I can see lot of problems. No decoupling capacitors on ATMega. Capacitors on both sides voltage regulators are usualy essential for regulator stability. Big voltage drop on regulator - if it's overheating, thermal shutdown might happen. For example 7V drop @ 350mA (about four relays) results into 2.45 Watts turned into heat. Bare HC06 doesn't like 5 Volts ...


3

Basic safety precautions: Always fully unplug the lamp before working on any wiring, even when working with the low-voltage side of things. Invest in a proper enclosure and follow the rules of insulation and earthing: if the enclosure is metal or has exposed metal they have to be earthed. If it is plastic it is insulated and there is nothing to earth (...


Only top voted, non community-wiki answers of a minimum length are eligible