Hot answers tagged

5

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 &...


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

The pins have input protection diodes that clamp the pins to Vcc and Gnd. If a pin gets to >VCC +0.5V the positive diode clamp conducts and Vcc is powered via the internal Vcc bus, and if a pin get to < -0.5V the negative diode clamp conducts. With Vcc = 0V, the pin could act as if it were a low, but more generally folks see the chip acting like it was ...


3

Is my idea sensible and achievable (technically)? Yep, sure is. It's not really much different to a DIY Reflow Toaster Oven. I know that I will need a 240V relay to control the heater. Is this safe and reliable? ** This is my biggest concern. What can you recommend for this - there are so many available on the market. I would suggest an SSR instead of a ...


2

As it sounds like you do not own the buzzer (it is part of the appartment), someone may not like you directly connecting to it. If this is a classic buzzer with an electromagnet, consider using a Hall Effect Sensor. The magnetic field generated by the buzzer may be able to activate the Hall Effect Sensor and inform the Arduino the buzzer has been activated....


2

Looking at the schematic, here are some points to be kept in mind when using this relay board: The relay board should be powered through the 12V connector The relay board has its own 5V regulator The optocouplers are attached in "reverse" So, the external connections should be Connect all the arduino grounds together, and connect them to the board ground ...


2

Consider constraining your design with clear requirements. As it is highly unlikely any design can protect its self for all situations. my relais module should keep a certain state (change of state is rare), no matter what happens to the arduino Consider latching relays where there is a set coil and a reset coil. Such as this one. Such a device ...


2

You might get away with powering a PIR sensor from a logic line. Check the specs. If it draws less ≤20mA you'd be fine. If you nee to drive more current than that you can use a CMOS TTL Driver or a properly selected N-channel MOSFET. Adafruit sells these, for example. A relay is another matter. If you this is one of those optically isolated relays and all ...


2

try changing the connection in relay module u can see that there are three pins in a relay. when you connect the output from the NodeMCU between the common and the NC(normally closed) pin of relay, makes the switch close and current flows (when the relay is not powered.) try connecting the output in between common and NO(normally opened). when you connect ...


2

You are using pin 13, but you set pin 10 as an OUTPUT. pinMode(10, OUTPUT); Try changing that to pinMode(pinOut, OUTPUT); PS by not setting pin 13 to OUTPUT, digitalWrite(pinOut, HIGH); enables the internal pull-up, instead of "connecting" it to 5V. The internal resistors are around 35kOhm. So pulling a bit of current through them will result in a lower ...


2

I don't think there is a need for a specific "normally-open" opto-coupler. Same result can be easily achieved by using "normally-closed" opto-coupler and making a slightly modified "NOT" logic gate using three resistors and NPN transistor. 1. When INPUT is LOW: Base of Q1 is shorted to ground through R1 so Q1 not letting the magic pixies go through. This ...


2

If it's working with 12v on the input but not 5v, it sounds like the base resistor value (which is missing from the diagram) might be too high. A value of around 1k should ensure the transistor is fully switched on.


2

There are two solutions: Use the pin as a open-collector pin as in the answer of VE7JRO. Switch the pin between input (high) and output with low. I prefer to use the INPUT_PULLUP. Write the output value before setting the pinMode. All the microcontrollers of the AVR family (ATtiny and ATmega chips) allow to set the output value before setting the pin as ...


2

From the image in the question, the jumper across pins J5 (in the below schematic) or JD as on the silk screen on the PBC is missing. Using the above schematic, a choice to power the Ardino and the relays off of one 5V power supply can be made. This appears to be done by connecting the 5V to the VCC pin, Ground to the GND pin & placing a jumper across ...


2

Yes. There's not a lot more to be said really. It's a relay, and they provide a MOSFET and associated circuitry to drive it cleanly. Just connect power and ground to the Arduino, along with the "Signal" pin to the GPIO pin of your choice, and away you go. Note that the relay is a 3.3V relay, so you must power it by the 3.3V pin, not the 5V pin.


2

That appears to be a 12 "solid state" relay. That means that it is designed to be both powered by and switched by 12V. You're trying to drive it with slightly more than 1/3 of its rated voltage. Don't do that. Edit: Note that none of the relays being discussed are true solid state relays. These are are all conventional coil relays that include cicuitry ...


1

The problem is most likely EMI (electromagnetic interference) from the switching of the inductive load by the relays. The fact that you have your setup on a breadboard means that each and every pin of the ATMega328 is connected to a little antenna. That massively increases its susceptibility to falling prey to EMI. Add to that the fact that there is ...


1

If you have a relay that is activated by a LOW or ground path, and is deactivated by an open circuit or HIGH signal applied, then you could try switching the pinMode to act as the HIGH or open circuit. const byte pin = 2; void setup(){ // Define the pin as INPUT_PULLUP until you are ready to use it. pinMode(pin, INPUT_PULLUP); } void loop(){ ...


1

As fas as I know, by default digital pins are set as inputs. Arduino has internally only pull-up resistors, which you can use in that way: digitalWrite(pinOut[i], HIGH); in first setup() line (without pinMode(pinOut[i], OUTPUT);). If you need LOW state on start-up (pull-down resistors), you have to use an external resistor.


1

I would unsolder the switch then solder in a FET in the configuration shown below. The FET will act as a switch and may be controlled with any digital output from your Arduino board. When selecting a FET makes sure you find something that will fit the foot print you have to work with on your board, and the gate-source threshold voltage is rated to handled 5V....


1

Most relays have their ratings written on them. You can also find all the information you need in the datasheet for that relay. Search for the part-nr in your favorite search engine. You need to find a relay that can handle at least 24Volt DC. Not AC as relays can handle a much higher voltage at AC than they can at DC. You also need to check how maximum ...


1

IO pins 0, 2 and 15 are boot configuration pins. 15 must be LOW at boot, 2 must not be LOW at boot and 0 determines the flashing mode. For normal run pin 0 must be HIGH. The NodeMcu board has necessary pull-up and pull-down circuits. You can connect to pins 0, 2 and 15 only devices which don't change the boot state.


1

do I have to duplicate that circuit just for the relay? No, not really, no. Is the ATTINY capable of triggering a 12v relay via ground? The ATTtiny is capable of triggering a transistor - the transistor is capable of triggering a 12V relay. Unless your relay is incredibly high powered and the coil takes (and generates through back-EMF) massive amounts ...


1

NC is "Normally Connected" - this contact is connected to COM ("common") if coil of the relay is not powered - the relay is disconnected. NO "Normally Open" is connected to COM when the coil of the relay is powered - the relay is connected. Some relays have the coil powered when the signal from MCU is LOW. If the coil of the relay doesn't click, but the ...


1

What could be going on here apart from what @JRobert has suggested, is, LM7805 could be generating a lot of heat loss. 4 X Ultrasonic sensors (SR HC-04) would draw 60mA. 2 X Relays (SRD-05VDC-SL-C) would draw 71.4 X 2 i.e 142.8mA.(Depends on from where you signal it) The Arduino mega would draw anywhere between 200 - 500 mA.(even more) The amount loss you ...


1

It sounds like a power-to-ground short circuit, either a fault in the Ultrasonic sensor or in the connection to the Arduino. Check your connections, and if you have an Ohm-meter, check the resistance between the sensor's power and ground pins. Current consumption is a function of the device being powered, not of the power-supply, unless the supply lacks ...


1

Serial connection requires connecting transmit TX pin to receive RX pin. Your SoftwareSerial pins ar pin 6 RX and pin 7 TX. So your wiring should be esp8266 TX to Uno pin 6 and esp8266 RX to Uno pin 7. Connect 5 V and ground to the pins header, not to screw terminals. The IN terminals are for powering the relay coil. Call read readRx() in the loop(). Add ...


1

If this is a noise issue, there are a number of mitigating actions to consider. Also, consider that most if not all noise mitigating approaches are generic and may not apply to all situations. It is almost always easier to mitigate noise at the source. Filtering the power & shielding are two approaches. When laying out digital integrated circuits, it ...


1

Working from shiftOut() backwards: Parameters for shiftOut(): Syntax shiftOut(dataPin, clockPin, bitOrder, value) Parameters dataPin: the pin on which to output each bit (int) clockPin: the pin to toggle once the dataPin has been set to the correct value (int) bitOrder: which order to shift out the bits; either MSBFIRST or ...


1

I have run into a similar situation on a few occasions. Maybe my scheme will help. What I do is sense power loss early, so I can save a structure full of all my program states to EEPROM when the power is going away. Conversely, the first thing the program does on power up is restore the memory structure from EEPROM. Provided you save your relay state ...


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