I need a very easy way to convert 0-5v from "analog" output in arduino nano to 0-32v proportional ... no big current , since it is just a signal.
So when output pin is 5v (or pwm 255 ) then I should have 32v output and 128 value should be 16vol....and so on.... i mean maybe call it a programable level shifter.... any idea? thks veryyyy much.
use is for a bike speedometer whose signal is from 0 to 32vol and its display is 0to50kmh.
now i want to control from the arduino.
Classic nano doesn't have analog output, it can output 5V PWM.
What about 0-32V? Can it be 32V PWM as well? Then you could use optocoupler for example.
You didn’t say ‘electric’ scooter, but you did say 84V, and that pretty much rules out internal combustion engine.
An electric scooter will inevitably use electronic motor management that internally works with probably 5V or 3.3V. I expect the speedometer to use that as signal voltage. A supply voltage of 84V isn’t logical but not impossible, so more info is needed.
Look more closely at the speedometer, can you find a part number? How many connections does it have and how are they labeled? Photos would be nice.
yea i can show this picture but forget about the uses and if you could help just with a simple circuit that from arduino pwm 5v output can mimic a 0 to 32v proportional signal
OK
There probably is no easy way for you to do this. I don't see any way of doing it with off-the-shelf modules/boards. It is possible to build a circuit using a few opamps, transistors, voltage regulator, resistors, etc.
I still don’t know how your instrument works. But producing a voltage up to 32 V is not too complicated. Be sure that you use components that can withstand the supply voltage you’re using.
Stitech thanks I will try it of course.... looks promising. i have a Uno r3 here (not a R4 minima) to test with.... also those npn can be any also smd? .... the iinstrument is like a tester.... it is very common in cheapss electric scooters and ebikes.... works with a volt variable if you provide 1V your display will show 1kmh. if you go to 2v then 2kmh... it is not limear so around 30V it will show 42kmh and 60v around 86kmh.
the new controller i bought is capable of send real speed and amps in a data line that is the reason why of the lower round display but the bigger display is stock one and only works with this 0v to xxV to show kms/h in 0 to 100km range (0v to around 62v)
so if your sketch works for me i will adapt to output at pin5 the value i want according to the real speed in the data line arduino has from serial input ...
So the idea is to replsce my current arduino nano that works with the lower round display to show amps and volt from data line (received from the controller) with your UNO R3 and the speed data from pin2 is available to produce this "almost linear" volt output to the speedmeter!...
i will see where can i fit in the code the pin2 data of the speed to produce the required output volt.
thanks i hope cleared the way ir works
just in case:
bike: sunra hawk
new controller: votol em100
round tft; common 1.28" with nano
volt pack: 88v
I realized that my circuit wouldn’t do well for low output voltages. So I changed the current sources for current mirrors. I also added a constrain() function to the sketch.