Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By scorpion
#90576 Hello, i am new here and in electronics!

I have wrote code that switch on a relay based on some sensors which controls a solenoid (350mA) using arduino Uno. It works fine!
Then i put the esp8266-01 so i can see the sensors reading. I connected an android phone to the wifi using remoteXY app and all the measurements are shown perfect. After a while the arduino gives command to the relay to close which i can see it to my screen. But the time that relay opens the esp crashes however the solenoid and the relay continuous to work.

I have a 12V 3A external power supply from which takes power the solenoid and the arduino, with a buck down converter to 5V take power all the sensors and another converter makes 5V to 3.3V to power the ESP. I have used diode for the relay and the RX TX etc of the ESP are connected right. The code beside the remoteXY library is very simple (just an If function with output HIGH/LOW).

If the relay doesnt work the wifi connection is good for hours and i can see all the sensors live. So something has to do with the power from the sudden open of the relaybut i can not figure out!!

Also i have used 1000uF electrolytic capacitor close to the ESP.
User avatar
By StanJ
#90589 You're going to have to connect a USB>serial interface (FTDI or equivalent) to the ESP-01 to see what's going on. My guess is that your WiFi handler is throwing an exception and causing a reboot. You'll also need this to decode the exception:
https://github.com/me-no-dev/EspExceptionDecoder

Copy and paste EVERYTHING between the two cut points and drop it in the decoder to see what went wrong. You're the only one that can do this, as the addresses are unique to your specific compile, and they will change with the next recompile; the decoder is only valid for the current compile.

Once you've gotten that far, post your code (or a link to it). I'm useless at spotting most errors like you've probably done, but someone else might spot the flaw. Without your code and the details of what caused the reboot, nobody will be able to help you.
User avatar
By rudy
#90595 Do you have both a relay and a solenoid? You said you have a diode for the relay but you did not say that you have one for the solenoid.

Is the relay turning on the solenoid, and when you turn off the relay/solenoid, then you get a crash?

If the solenoid does not have a diode across the coil then you need to add one there as well.