Author Options:

How do I use an Arduino to write say 2.1 volts? Hobo dataloggers accept 0-2.5vdc inputs. Arduino outputs PWM.. thanks!? Answered

I'm working with a university and they love their Hobo's and I don't blame them... they're pretty straight forward to use... 

I'd like to write to the Hobo... here's the hobo analog inputs: 0 to 2.5 Vdc; 0 to 5 Vdc; 0 to 10 Vdc; 4-20 mA

Hobo stats: http://www.onsetcomp.com/products/data-loggers/u12-006

Analog channels: 0 to 2.5 Vdc; 0 to 5 Vdc; 0 to 10 Vdc; 4-20 mA

Accuracy (logger only): ± 2 mV ± 2.5% of absolute reading; ± 2 mV ± 1% of reading for logger-powered sensors

Resolution: 0.6 mV

Sample Rate: 1 second to 18 hours, user selectable

Time accuracy: ± 1 minute per month at 25°C (77°F), see Plot A

Operating range: -20 to 70°C (-4° to 158°F)

Operating temperature:
Logging: -20° to 70°C (-4° to 158°F)
Launch/readout: 0° to 50°C (32° to 122°F), per USB specification

Humidity range: 0 to 95% RH, non-condensing


The short answer is that you feed that PWM signal through a simple low-pass filter, the kind made from just  a resistor and a capacitor.  Such a filter will take out the quickly switching on-off, AC component, of your PWM signal, and leave only the DC part,  which is just the time averaged voltage.

Regarding the long answer, I did some searching via Google(r),
guessing maybe  someone had already gone to the trouble of explaining this topic in greater detail, and I found this page, which is specific to the topic of low pass filtering your Arduino(r) 's PWM outputs.  Um, here:


And I'm hoping that page will tell you everything you want to know, or at least get you going in the right direction.


so put a big smoothing capacitor and resistor on the analog output and you have a value from 0-5 volts. Make it into a resistor divider and you can make it go from 0-2.5 volts.

Most serious question, why not get a sensor that outputs an analog value? An arduino (atmega) isn't a particularly good sensor. If you already have an analog output sensor then you could again use a resistor divider to drop your (probably) 5 volt output to a loggable 2.5

thanks for taking the time to answer!!