In the last few days i read a lot of the Analog input voltage converter.
So I know, that the wemos d1 has a onviard voltage converter.
If Andy device is connected to A0 and GND, the wemos can read the voltage from the external device, BUT not in voltage. The ADC gives a binar code.
1V input gives the value 1023
500mv gives 512 ADC
If the device use more than 1V, the voltage converter change the ratio
Before 1V = 1023 ADC
So 1mV = 1,23 ADC
If more than 1v input
3.3v is 1023 ADC
So 1mV = 0.31 ADC
Okay. Now my problem:
My anemometer (weather station) produce mV, if the wind spin it.
If the wind is not so fast, it produce only a few mV... like 500mV
But if the wind is very strong, it can be produce more than 1V (max 2)
My script detect the ADC and calculate it to Voltage. The voltage can be calculate to the wind speed and so I know the speed of the wind.
Rhat wirks great.
But i found a little mistake in my idea.
When the wind blow and the anemometer spin and produce 416mV it will be show 512ADC
But
When the wind blow strong, and it will be produce 1.65V, the ADC is 511.
Thats the same ADC..... you understand...
Know i need to know, if the voltage reducer set 3.3v to 1023, or 1c to 1023
I am assuming you have a voltage divider in the analog section of the circuit. You need to change the divider ratio as the voltage increases. Basically you are making an automatic voltmeter. The Arduino has control of the division ratio and can change its conversion formula accordingly. Post an annotated schematic and we can check it for you.
There is a built-in voltage divider. A 3V input is scaled to 1V (the ADC's limit).
Also, note that the ADC isn't linear (esp. near Vmin and Vmax).
You can add another resistor in series with the "A0" input (another 220k) to make it a "5V" input.
how can i detect, when the wemos change the ratio??
i use it as voltmeter.
i don't want to use a second voltmeter to check if the volts are more than 1V
my idea is not so good.....
i think it would be work with two extra resistors
if i add a 200ohm and 100ohm resistor to the anemometer cable, i will reduce the vltage to 1.
so it would be always: 1V = 1023
for example:
i use 2V in:
the resistors reduce it to 0,6666666666666666V
if i use 1V in:
the resstor reduce it to 0.333333V
the final value is to re-calculate it with the two resistor value. they are static.....
Parallel R2 with a second resistor that goes to the drain of the MOSFET, reason for the MOSFET is to protect the Analog input. When the MOSFET is off you would be in your sensitive range, with it on you will have less sensitivity but you can take more volts. The attached circuit is a programmable gain amplifier. Remove OA1 and R3 for your circuit. Then you would size R1 for your low voltage and R2 in parallel with R1 for your high voltage. The mosfet can be driven by one of the digital pins.
that looks great, but i think it's to dfficult for me.....
the option with a second resistor in the plus cable looks easier for me(newbie), but i think your idea is really great, cause i can control it with a digital output. but that is to much for me.
Power is voltage X current.
With 5V applied (as previously mentioned). there will be about 2V across the 220k (each) and 1V across the 100k.
That results about 10 microAmps.
2V * 10 microAmps = 20 microWatts.
1/8W resistors will be fine, 1/4W resistors will be fine, 1/2W resistors will be fine.