Har köpt en RGB rotationsenkoder som jag nu ska försöka koppla in till min NUCLEO-F303K8. Det som förbryllar mig lite är hur jag ska koppla in själva RGB delen, min första tanke var att det bara var som vanligt och använda ett lämpligt motstånd i serie för R, G, och B (se bild 2 nedan). Läste sedan några kommentarer för enkodern i den tidigare länken som gjorde mig fundersam:
The diagram for this unit may look strange for the LEDs, but it’s accurate. You’ll need to supply positive voltage to the unit, and the RGB pins will need a transistor if you want to control their state from a microcontroller (I used NPN, and supplied output from Adruino pin to the base of R,G,B pin transistor).
Vill inte riskera att paja någon pinne på mitt utvecklingskort så min fråga är hur ska man koppla in dessa transistorer? Så här (en LED-strip men det borde väl vara samma)?Finally, you WILL need a current driver for the LEDs. Don’t try to drive those bad boys directly from a Due or Teensy - you could kill your poor chip. Also the forward voltage for the green and blue LEDs are somewhere around 3.3v so that leaves scant voltage after the cutoff on 3.3v systems (and the RMS voltage will be even lower). I suggest a separate driver circuit using tip120, bc547, or even 2n2222s. Since you should treat the leds as a power device it makes sense to have a separate power supply for them (leds can be quite the current hogs and three in parallel just increases that current threefold). DON’T FORGET current limiting resistors. You will end up with a fried diode otherwise.
Hittade också ett exempel där de struntat i transistorer, detta var även min första tanke, men vill inte testa ifall jag riskerar att ha sönder kortet (vet ej om ett NUCLEO kort har känsligare pinnar än en Arduino):
/Daniel