There's nothing wrong with wiring it straight to the battery - if everything works the way it should do all the time. But you can't be too careful with anything electrical wired straight to the battery - you need to think through the consequences of something going wrong and take precautions.
Firstly, put a fuse in the circuit. That means if the charger shorts out something (the fuse) will give before the wiring catches fire and takes the rest of the bike with it (maybe).
Next - I put a switch in circuits like this so I can switch it off when its not being used. That means there can be no battery discharge at all when the charger circuit isn't being used for charging. It depends on what you're going to be connecting to the battery but some electronics can have a low level of current use in standby mode and without a switch they're taking that from the battery all the time.
Third - think through the effects of both (rain) water and vibration on whatever you're connecting to the battery. Get rain water into a live charging circuit and you could well end up with a short and blowing the fuse. That's where the switch comes in.
Vibration (depending on the bike) can shake electronic circuit boards to bits, and if the charger or whatever you're using isn't designed for bike use it probably won't be "shockproofed". I've made a reasonable number of DIY bits of electronic kit for bikes and I usually cover the circuit boards in hot melt glue or something to stop vibration effects. Two lighting circuit boards I bought recently and didn't check broke within 500 miles from vibration.
|