I would like to read a wide voltage range with my arduino. 6-45 volts, I need 0.1 volt accurncy, but the analog in only read 0 - 5 volts. How do I do this in the best way (using the least amount of components?)
Do I have to setup a number of voltage dividers? Or is there a better way of doing this? :-?
Basically yes.
You can have them switch if you want so you can alter the sensitivity from software but I would arrange a series resistance and some rail catching diodes in case of accidents to prevent more than 5V getting on the analogue inputs.
With a single 1/10 voltage divider you would get about 0.05V per step (50/1024) from the Arduino analog to digital converter. This should be sufficient towards a voltage reading with 1 decimal precision as per your requirement.
I would get 1% resistors or better (0.5%). In a voltage divider like that, 1% resistors give you about 1.8% worst-case accuracy (one is at max, the other is at min) and 1.8% of 45V is 0.81V. That's divided down, but still near the range of accuracy you're looking at.
Since you're feeding this voltage into an AD converter and microcontroller (Arduino), you can measure the exact resistance with a multimeter and calculate accordingly. If you mass produce it's a differenet ballgame (per unit calibration will be needed), but for a one-off it doesn't really matter whether resistors are 0.5% or 5%.
Once you have it built you can measure what you're reading and look at the difference the Arduino is reading and set up either a lookup table or a formula for scaling the results. Then you can use 5 percent resistors and save money.