If you wish to use the 'defective light defense' then you need to do a couple things:
1. You need to verify that the intersection is controlled using traffic sensors. Look for magnetic sensing loops cut in the pavement where you were waiting for the light.
2. Verify that the sensor will not detect your bike. Try rolling up to the light in the same direction you were riding sometime when there is not enough traffic for another car to come by and trigger the light. Make sure that the sensor does not trip the light for you.
If your tests show that the light would not trip for you, then you can argue in court that the light is defective for your bike. If you have prior experience with this trafic light, it would be best as you could argue that past experience demonstrated that the light could not detect your bike and so, based on that experience, you did not wait on the light and proceeded at the first safe opportunity.
If the light does not use sensors, then you would be best to try to take a defensive driving class so the ticket does not go on your 'driving' record. Hopefully, your state allows this. Otherwise, you may be able to ask the judge for 'deferred adjudication' where you pay the fine and get put on probation for a period of time. If you don't get another ticket, then the conviction is erased and does not count against you.
Of course, this is not legal advice. It's only what I would try to do. You should probably talk to a lawyer if you wish to pursue a defense.