I've read a lot online and on this forum about the topic but i'd like to have your opinion on the matter.
First of all i'm a novice in electronics, my strong suit is programming.
I recently wrote a sketch (and it works just fine) to read data from some sensor on my motorbike (temp, humidity, gyroscope, accelerometer etc) and i'm planning to add more.
I'm currently powering arduino UNO with a 9v battery because i'm avoiding all the "it's tricky to power up arduino directly from the bike battery" thing.
But i decided to finally try and power it up directly from the motorbike battery (choosing a source under key).
How should i proceed and what do i actually need?
I was thinking to use one of the many 12v to 5v usb phone charger that can be found online but i don't know if it's the best choice.
Again i'm a novice in electronics, so anything that comes ready out of the box is to be preferred.
For low current applications a simple Buck Converter will do fine. Like these or if you want a bit more fancy one like this. I have used both and both do fine. That said unless there is concern about noise on your motor bike system I would just run off the bike's 12 volt system. Finally yes, I see no reason why you can't use a phone charger as long as it meets your requirements.
You’re facing a very complex EMC problem of susceptibility the Arduino to conducted and external emissions. I cannot see what you have but past practice tells my you will have ignition noise, transients etc both plus and negative. Expect if the battery disconnects for any reason while running you will get a very big transient. Hopefully you get lucky and have none of these just be prepared for them. Consider using a SEPIC converter to protect the electronics using a diode in + to protect from reverse battery connection. You can get them that will work from about 3 to 30 volts and output about 8 volts (12 no problem) at several amps.
@gilshultz do you think buck converters sold for automotive use will provide better protection for @salvaslash86 's circuit, or is that a naive assumption?
They will take the 24V transients and the double battery jump. Depending on the design when they fail so will the output protecting the Arduino. They will not take the reverse battery jump or load dump transients, you also need to protect for that and other items. They will run a lot cooler and save power. On the mechanical side you will have vibration, shock, temperature etc. I do not know much of anything about motorbikes but I am familiar with alternator charging systems.