# Converting 12v to smooth 5v?

I’m working on a motorcycle here. I have a 12v battery to work with and a stator that produces (limited) power. I have a throttle position sensor that I believe needs 5v input and outputs up to 5v.

The question is: how do I convert ~12v to 5v? The 12v may not be exactly 12v and if my understanding of motorcycles is accurate it may fluctuate as I ride. Is there something that can take let’s say 11-13v and always output almost exactly 5v? Minor fluctuation is fine but any fluctuation would be seen as a changing throttle position. 10% is a huge error. More like 2-3% error would be nice.

Whatever device it is, if it doesn’t use up too many amps that’d be nice as my stator can only handle so many amps drawn.

Thanks!!

• Welcome to EE.SE! Have you looks into a standard diode bridge, capacitor and 7805? – winny Dec 15 '18 at 18:19
• You really should check what voltage is needed by the TPS. As it is for something that needs to be reliable, you probably want to look at an automotive grade regulator. E.g. Infineon make some. – Andrew Morton Dec 15 '18 at 18:59
• ...and how much current does the TPS need? – Andrew Morton Dec 15 '18 at 19:02
• have you asked mechanics.stackexchange.com ? – Jasen Dec 15 '18 at 20:24
• What is the throttle position sensor connected to? – crasic Dec 15 '18 at 20:27

The type of device you're looking for is called "voltage regulator". It is an integrated circuit where the input is a certain voltage (eventually not stable over time, due to temperature changes or other causes), and it outputs a steady (i.e. constant) valute of voltage. In your case, you need to convert a possibly fluctuating value around 12 V to a constant value of 5 V. As suggested in another answer, you could use the uA7805 model of the uA78xx series.

As suggested in Figure 1 of the datasheet at this link, you also need a couple of capacitors to make it work properly.

• I suggest suggesting something which is automotive grade: having the throttle suddenly go to 100% when on ice or 0% when overtaking is... undesirable. Or a circuit which compensates for the unruly electrical environment of a vehicle. If it was to power some non-essential replaceable gizmo, I would agree with a 78-series regulator and a couple of capacitors and a reverse-voltage protection diode. I am not an electrical engineer. – Andrew Morton Dec 15 '18 at 19:49
• Personally i don't see reason to separate 78-regulators from automotive grade electronics. As long as any single failure won't render the system unusable or dangerous, common electronic components are very well suited for automotive purpose. Although this is often much more easily said than implemented... – olltsu Dec 16 '18 at 8:28
• I wouldn’t say this will be a safety concern for me. The 5v is to power a sensor whose data will inform tuning of the vehicle. Bad TPS data might lead to a bad tune, but probably not an unsafe vehicle. – Kyle Robson Dec 16 '18 at 9:26

The two metrics that you're interested in are:

'Line regulation': the ability to maintain a consistent output voltage while the input voltage varies.

'output voltage ripple': the peak-to-peak variation of output voltage.

There are a few methods of achieving a lower voltage from some higher voltage source:

A linear voltage regulator will drop the voltage from ~12V to 5V but will do so in an inefficient manner and will usually have low current capability. The output voltage ripple of a linear regulator can be very low (good).

A switch mode power supply (smps) module will allow for much higher efficiency, and could support much higher power applications. The output of a smps will usually have a higher peak-to-peak ripple voltage than a linear regulator.

Both types of voltage regulators should have acceptable line regulation, though the datasheets should be consulted to be sure.

• Hey thanks! I’ve been looking at the 7805 and the buck converter (I think this is switching). It seems the buck converter is efficient and easy to connect wires onto. Should this be good for the job? I recently found out another motorcycle tinkerer has used the 7805 successfully so I guess I could surely go that route. – Kyle Robson Dec 16 '18 at 9:33
• I'm not sure exactly which part you are referring to, but the LM7805 is a linear regulater. Depending on the current drawn by the throttle positioning sensor (TPS) , the LM7805 could be a good option. The LM7805 will accept upto a maximum input voltage of 35V, and can supply upto 1.5A output. I dont own a motorcycle, and have never worked on one, so im not familiar with the levels of noise to expect on the 12V battery whike the bike is running. If the noise is too high for a stable output voltgae on the LM7805, try increasing the value of the input capacitor. (I'd start out with the recommend – user16487 Dec 18 '18 at 18:08
• (I'd start out with the recommended capacitor values in the datasheet) I'd assume that the TPS wont draw more than 1.5A, but you should check the datasheet of the TPS to be sure. – user16487 Dec 18 '18 at 18:09