Is there a way I can generate 0 to 50mV for a meter (dc most likely) from an Arduino Mega?? Any thoughts would be appreciated.
I need two of the sources. so the cheaper the better.
~~Cris
Be sure to click 'more' and select 'suggest as answer'!
If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!
Is there a way I can generate 0 to 50mV for a meter (dc most likely) from an Arduino Mega?? Any thoughts would be appreciated.
I need two of the sources. so the cheaper the better.
~~Cris
Hi Cris,
I just remembered I had to drive a meter with Arduino too a while back, although I used an Arduino Micro, maybe the ideas are similar with Arduino Mega).
The info is here:
Sensirion Gas/Temp/Humidity Sensor Kit - Review
The code is here:
https://github.com/shabaz123/FeelWellMeter/blob/master/env-sensor.ino
I don't remember it in any detail, but line 23 in the code there defines the constant 'meter' to be pin PB5, where the meter is wired as can be seen in the diagram above.
Lines 339-344 set up the PWM mode, and this may change on Arduino Mega.
Then, whenever the meter reading needs to change, then 'meter' is just set to a different value.
For example, to make the needle swing to maximum, then wait three seconds, then swing to minimum, the following code is used (max and mmin can be calculated or just try any values for experimentally determining them, in my case they were 100 and 3500 respectively, for the 100uA meter):
shabaz looks very straight forward I shall give it a try. From what I am seeing for my 50mv meter all I will have to do double R1 to about 95 ohms.
Thank you immensely.
~~ Cris
shabaz I also looked at your stuff on git hub. nice work. You don't mind if I borrow some of it. And of course, I will give affirmations. in each function.
~~Cris
Hi Cris,
Great, I hope it helps! Feel free to use any code, and looking forward to hear how it goes!
Hi Cris,
Great, I hope it helps! Feel free to use any code, and looking forward to hear how it goes!