I want to make my arduino turn on/off a solenoid valve. Because the valve requires 9v, I decided to use a relay. I didn't find nearby any 9v relay. I got a 12v relay instead. When I was trying to test it, with my 9v battery (red wire to NO pin, black wire to C) something started to smell and I touched the relay and it was really hot. What happened?
Post a connection and wiring diagram.
you created a short....
the relay is just a switch along ONE wire. the other one goes straight to the load
(from https://arduinogetstarted.com/tutorials/arduino-relay)
(replace the bulb by your valve - hopefully it has an embedded freewheel diode)
The best guess is the wire is to small or shorted. Post an annotated schematic of what you have wired be sure to show all power, ground, and battery connections. You got a lot of places to make connections and my eyes are not good enough to see what you are doing. A clear uncluttered picture may also help.
I see your post where is the battery. Also what are the ratings of the relay, the voltage of the mains and wattage of the bulb. I am assuming you cannot draw a solenoid so you are using a bulb.
yeah it's the wrong way... as in the picture above, only one wire goes to the relay (in an out basically) the other wire goes to the device you want to power
see that as a switch that you can control through software rather than pressing on it
Umm. you are directly connecting + - terminals.
Short circuit!
Take a look at this.
Warning I did not use a resistor for the LED.
I hope you have a lot of spare parts. Never put a power source (Both Plus and minus) across a relay contact. Relay contacts go in series with the load so wire from battery to relay NO. From relay C to load and from load to other side of the battery. Note LEDs fry very rapidly without using a resistor, You need something in the 1K range to start with. You can go to a lower value later if you want it brighter but this will keep it from destroying if connected to 12V. If your load is the LED it is polarized and will only working one direction. When you connect it to the battery and the NO contact short the NO to the C and it should light, if not reverse it.
Two important points: A power supply the Arduino is NOT! Those little 9V batteries are not for Arduinos, they do not supply enough energy.
And β¦ if you get an unfamiliar part , study it , look at examples or data sheets before you use it- itβs easy to destroy parts by wrongly connecting them
You connected the OUTPUTS, NOT THE COIL.
If I understand correctly, should I do it like this? I don't want to test it before you tell me because I don't want to mess up my relay

your 9V alkaline battery won't be suitable to drive the valve. it's OK for a smoke detector but you can't draw much current out of it. you need a much more capable battery pack.
You'll probably need a freewheel diode for your solenoid valve and a decoupling capacitor for the ESP32 power supply.
Your question about NC or NO depends on what you want to do
NO = Normally Open ==> when there is no command, the circuit is open, no current goes through
NC = Normally Closed ==> when there is no command, the circuit is closed, the current goes through
No my relay has some weird symbols. What are those?
What is a freewheel diode and why I would use a decoupling capacitor.
(Note: the solenoid valve is taken out from a device that utilized a 9v alkaline battery which connected directly to the valve)
Look up those terms
Can you post a picture of your relay?
This is the 12v relay that I have (2 of them just in case).
I doesn't have NC, NO, C symbols. It has weird symbols. What do they mean?
The 12v for the relay is referring to the voltage needed to power the relay coil, not the voltage that it is switching. With a 12V relay, you need a 12V power source for the relay itself, and in any case you do not want to power a relay from the 5V terminal of an Arduino, that can lead to spikes on the power supply that may cause the arduino to reboot, and the relay likely needs more current than can be supplied by the on-board regulator.