moderndevice / Wind_Sensor

Documents and Arduino Code for using the Modern Device Wind Sensor
23 stars 20 forks source link

Code only works on Arduino Uno #2

Open brownrb opened 4 years ago

brownrb commented 4 years ago

Can you please provide details on how to calculate wind speed using something like an ESP32 chip that uses 3.3V and 12bit ADC (4095)?

The example you give assumes 5V and and ADC with 10bits (1023). The promo keeps talking about it works on 3.3V but there are no examples for this

CarlosChillonGeck commented 3 years ago

I am facing the same problem. More details on how to make it work with an ESP32 would be appreciated. Powering the Rev. C with an external power bank seems to give unstable voltage supply to the sensor. The 3.3 V output of the ESP32 gives a stable voltage supply, however, the wind speed values obtained this way are too high and a calibration using the zeroWindVoltage doesn't make sense.

moderndevice commented 3 years ago

Carlos,

The external source at 5 volts is the way to go - MAKE SURE - to tie the ground together with ESP ground. There is no reason for that to be unstable.

I’m rebuilding the wind tunnel now to try to get some better math. I’ll get to the conversion though - it shouldn’t be that hard.

Paul Badger Modern Device

On Feb 9, 2021, at 10:17 AM, Carlos Chillón Geck notifications@github.com wrote:

I am facing the same problem. More details on how to make it work with an ESP32 would be appreciated. Powering the Rev. C with an external power bank seems to give unstable voltage supply to the sensor. The 3.3 V output of the ESP32 gives a stable voltage supply, however, the wind speed values obtained this way are too high and a calibration using the zeroWindVoltage doesn't make sense.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/moderndevice/Wind_Sensor/issues/2#issuecomment-776015157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACVBN3L4LI6Z5XZNG6WREDS6FGXJANCNFSM4LO47PJQ.

brownrb commented 3 years ago

No. They never ever got back to me. I kept getting garbage results - consistently inaccurate or not working at all, and I am pretty mean coder btw, after a few weeks I threw it in the bin and advised all my followers of what I had found.

In the end I designed my own using a 3d design and a sensor board, surprising accurate as well as having much better range.

 On Wednesday, February 10, 2021, 04:17:09 AM GMT+13, Carlos Chillón Geck <notifications@github.com> wrote:  

I am facing the same problem. More details on how to make it work with an ESP32 would be appreciated. Powering the Rev. C with an external power bank seems to give unstable voltage supply to the sensor. The 3.3 V output of the ESP32 gives a stable voltage supply, however, the wind speed values obtained this way are too high and a calibration using the zeroWindVoltage doesn't make sense.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

CarlosChillonGeck commented 3 years ago

Hello Paul and brownrb,

I tried to modify a bit Paul's code to make it work on the ESP32, until I got some realistic results for the wind speed. I obviously do not know how you did the calibration on the wind sensor using the thermistor of the board, so I am relying on the existing formulas you include in your code. But I only modified the code in order to make it work on the ADC output pins of the ESP32, which range from 0 V to 3.3 V and have a 12-bit resolution. Changing this gives me good results for the wind speed, however, not for the TempCtimes100 (which as far as I know should be the local temperature). Output voltages of the TMP and RV pins are near to those you describe in the modern device website when you have room temperature.

Could you tell from the code if my approach makes any sense? I attached a .txt with the code and an image of my output. revCcarlos.txt

Screenshot 2021-02-10 at 16 28 03

Best regards and thank you!