I have a higher voltage component (24V solenoid) controlled by a push button. I want my board to take a reading when I release the button. When I test the circuit using a 5V supply from the board it works fine, but once I connect the higher voltage (with resistors to reduce voltage and amperage to a level the board can handle) the board will reset whenever I release the button. I have attached my circuit diagram and code. Not pictured is a thermal sensor attached to A0 and the 5V supply from the board, but the outcome is the same with or without the sensor connected.
I am assuming there's something dumb and obvious I'm forgetting to account for.
I wasn't able to post this to a specific topic, such as Project Guidance, as the New Topic button wasn't there.
Button_Record_Temp.ino (917 Bytes)