08m2 variable voltage output

Steve2381

Senior Member
Hey all.

I have an Arduino circuit on another project that has an input that reads an 0-5V on an ADC input. I want to interface an 08m2 to that input.

Any easy options for obtaining a 0-5v output from the 08m2? I was thinking for PWM to an op-amp driving an LM317 (Won't get 0-5v however), but I was wondering if there was an even easier way?

Normally, I would send the data by serial, but I cannot convert the Arduino's ADC input.
 

premelec

Senior Member
PWM with filter likely way to go - what's the LM317 for? Do you need a lot of power? How fast does the analog voltage have to change? There are a variety of digital to analog converter chips you can drive serially from the 08M2... 8, 10, 12 bit. Basically digital potentiometers with appropriate number of taps to bits...
 

AllyCat

Senior Member
Hi,

I don't know the input impedance of the Arduino ADC, but generally a simple Low-Pass filter (R + C, no need for an Op-Amp) should work fine, if driven by a PICaxe PWM output.

If you want to generate a full 100% PWM level (no switching) then you can't set more than 1020 clocks to a cycle (i.e. period byte = 254) and of course you will lose some swing if the ADC input impedance is too low.

Alternatively, the PICaxe 08M2s do have a DAC output, but it has a (very) high output impedance, only 5 bits of resolution (33 levels) and it shares its output pin with the serial (programming) output, so not really recommended.

Cheers, Alan.
 

Steve2381

Senior Member
I really isn't speed critical. Only thought of the LM317 as I had one here! Certainly don't need any power level.
All I am doing is converting the output of a load sensor to the input of the Arduino. The load sensor signal is already converted into the 08m2 using a HX711 control pcb (thanks Ebay).

So, I have a reading in the 08m2 that needs converting to a value for the Arduino to display on a screen as a weight. The Arduino is default setup to display the weight as 1kg per volt, in 0.1kg steps (I can alter this).
Therefore, I ideally I need something like 50 steps maximum, as the sensor is 5kg max rated (and I will never have anything heavier than that being weighed).

This is not super accurate, and the measurements can take as long as they like. All it actually does is read the weight of my filament spool on my 3d printer.

For those who are totally bored (and you really will need to be bored), my website has my printer on it.... http://www.stevecroot.co.uk/
 

lbenson

Senior Member
I simulated varying voltage output by a salinity sensor by doing pwm from a 14M2 through a 4K7 resistor with a 1uF capacitor to 0V.

I don't know if that would give you an accurate and repeatable 50 steps.
 

Steve2381

Senior Member
Yep... I knew there was an easy way! Output through a 4k7 resistor, and tied down to 0v with an 0.1uf.
Sampling the sensor 30 times and taking the average is providing a nice consistent output varying from 0.1v to 4.67v, depending on the weight applied.
Thanks all
 
Top