***Technical question, not a wiring problem.
I am building a bicycle alarm system and I'm a little stuck on the alarm output. I wonder if I am approaching this problem wrong.
My alarm piezo technically is a 12 volt device but it works well on 9V.
My device is battery operated with a large 9 volt battery pack. The system is driven by a PIC32 microcontroller.
The kind it is is not important, but its a 3.3V device, so its GPIO pins can only output 3.3V and don't supply much current, so obviously you would not want to power the device using a gpio. HOWEVER I was thinking I could use the gpio to signal a transistor or a MOSFET to switch on the 9V supply. The alarm just needs a 9V power supply to emit a really loud sound.
I have worked very hard trying to achieve this.
First I tried some 2N3904 transistors and also some 2N3906s. The current requirements are just too high and they both got burned up.
Next I tried a MOSFET, the IRFZ44N specifically. I selected this MOSFET from DigiKey thinking it would be good because it can handle so much current.
HOWEVER I can't seem to get it to give more voltage than my gpio! My gpio is 3.3V and the MOSFET won't output more than 3.3V.
To be clear this is not a wiring issue! That is why I am not posting schematics. I am not concerned about wiring. What I really want to know though is whether this approach is flawed. Is it even possible to use a MOSFET or transistor to switch on a higher voltage using a smaller voltage as a signal? If so, then what is a good mosfet for this type of thing?
This is the speaker I'm using.
I don't know exactly what the current requirements are since there is no documentation on that but I would assume between 100 and 500 mA.
Also if you really want to know, my microcontroller is the PIC32MX795F512l all though I don't think that's really too important here.
If you guys need me to post any schematics, I will but I'm honestly just looking for general information here, not really a step by step guide on how to construct my circuit since I can definitely handle that part and most people wouldn't find that relevant to their own questions on this topic anyway.