I want to switch on/off some LEDs on a breadboard using my Raspberry PI (RPi) 4. Before connecting with my RPi, I've tried to do some experiments with using a BS270 FET in an old-fashioned "dumb" circuit.
Layout is a simple serial circut:
3V source (2 AA batteries) +
100 ohm resistor
LED
BS270 FET (D leg connected to LED, G leg not connected to anything, S leg to battery -)
(batteries - / cathode)
So it forms a circuit. I switch it on, and the LED shines. Problem is it always shines, as if the BS270 FET conducts current regardless of what I do with the G-leg.
As I understand it the BS270 should only conduct current if the G leg has voltage applied to it, like 3V. Seems like it doesn't matter if it has voltage or not. I'm doing something wrong, but I am not knowledgeable enough to understand where to look.
Update
I eventually got it to work with several GPIOs each toggling on/off their own transistor. This is the circuit I built for each. Apologies for any drawing errors (I'm an amateur):

