Suggestions

22 Sep 2010

I would like to consider using the mbed but I have a couple issues;

1. I need it to read presure sensors that output a voltage from 0.5 to 4.5 volts full scale. The mbed analog inputs can only read 0 to 3.3 volts. One alternative here is the company makes an Identical sensor that uses the I2C protocal.

2. Likewise, I need the PWMs to output 0 to 5 volts, but the mbed outputs 3.3 volts. I'm sure there is a way to scale this useing transitors, FETs, or some such but not sure where to start.

Whats your suggestions?

Thanks

22 Sep 2010

Hi Glenn, sounds like you've got a workaround for #1, you could also set up a simple resistor divider to reduce the voltage range of the sensor.

For #2, what are you driving? If it's any kind of significant load (lamp, motor, high brightness LED, etc.) you could look into a half bridge IC, or simple driver IC.  Ti 75441 or L293 are a couple of choices.

 

--steve

22 Sep 2010 . Edited: 22 Sep 2010

Steve, Thanks for the reply. I totally spaced putting that info in my post. The PWMs will be filtered with a low-pass resitor/Capacitor to flatten it out and it will then drive the LM3914N on the 0 - 5 volt signal source pin.

22 Sep 2010

user avatar Glenn Berden wrote:

Steve, Thanks for the reply. I totally spaced putting that info in my post. The PWMs will be filtered with a low-pass resitor/Capacitor to flatten it out and it will then drive the LM3914N on the 0 - 5 volt signal source pin.

Hi Glenn, and welcome

I'm not sure if you could just apply a pullup-resistor on the PWM to a +5V source, but otherwise, you could use an I2C potentiometer to drive the LM3914.

Ex. http://www.analog.com/static/imported-files/data_sheets/AD5272_5274.pdf

Regards,
Lerche

22 Sep 2010

Hi Glenn,

If you want to get a bit old school you could use a logic gate and drive the 3.3V PWM into one of the gates. If you power the gate form a 5V (i.e. the USB?)supply then this set-up should convert 3.3V to 5V as the gate will read logic high above around 2.2V.

Other options are to use a transistor, or a comparator.

Regards,

Martin

22 Sep 2010

Thanks everyone for the suggestions, but I'm not sure I follow. Excuse my ignorance, but how is tyeing the PWM to +5v threw a pu going to scale the voltage?

Maybe I am not explaining it correctly, I'm not looking for a logic high or low but rather a scale form 0 to 5 volts.

The MCU reads the sensor and sets the PWM to a percentage of what the sensor reads between to set points. If the sensor is at 50%, the PWM is set to 2.5volts, half of the max 5volts. If the sensor is read at 75%, the PWM is set to 3.75 volts, etc. This in turn then displays 0 to 100% on the 10 LED bar graph. So I need to scale the 0 to 3.3v PWM to a 0 to 5 volt output. 75% of 3.3v is 2.475, this will need to be scaled to 3.75 to show 75% (~7 bars) on the LED Bar graph.

The I2C potentiometer that Christian suggested might be a simple solution.

 

22 Sep 2010

Hi Glenn, you could use a small signal N-type MOSFET with a Pullup-resistor to 5V on Drain, which of course will lead to a 5V but also inverted PWM-signal. Another disadvantage of such a simple solution is, that the 5V state has a relatively high impedance (depending on the Pullup-resistor), which might interfere with the subsequent RC-filter. A better option would be to use a logic buffer gate IC with TTL-level compatible inputs powered with 5V. This would give you a low impedance 5V PWM-signal.

Best regards
Neni

22 Sep 2010

That makes sense. My apologies if this was the same others suggested and I simply didn't understand.

The Logic buffer gate sounds like that may do it. I assume then I would filter it after the gate correct? As long as the 5v PWM is proportional to the 3.3 PWM this might work.

The next issue I have is getting more Hours in a day so I can get all this done. I think this will involve a Flux Capacitor and a Dalorian of some type. ;)

 

22 Sep 2010

You can also get a port expander (if you don't have enough DigitalOuts) to light the LEDs using code and forget about the lm3914 altogether...

22 Sep 2010
user avatar Igor Martinovski wrote:

You can also get a port expander (if you don't have enough DigitalOuts) to light the LEDs using code and forget about the lm3914 altogether...

That would be an option if the display panel was not 40 feet away form the mbed. There are 3 graphs so that would mean 30 plus wires between them. Unless I put the Port expanders on the display. But I believe I2C is for very short comunications, I could also use use the RS-232 to communicate - but now I am getting more complicated than I want it to be.

the 0 to 5 volt output also serves a second purpose, to connect to analog inputs on other systems that don't communicate with CAN or RS-232.

 

22 Sep 2010

Mbeds are cheap. Why not put one at each end of the 40ft cable and hook them up with an RS484 style differential link? Only need a twisted pair cable.

22 Sep 2010
user avatar Glenn Berden wrote:

... That would be an option if the display panel was not 40 feet away form the mbed...

Ok.. I would still use some sort of digital LED driver, but its up to you. Make sure you put the capacitors on the sending end of the wire. Also make sure the capacitors are appropriately large, at those lengths you might get some inductive spikes at the sending end if you're not careful.

22 Sep 2010 . Edited: 22 Sep 2010
user avatar Andy Kirkham wrote:

Mbeds are cheap. Why not put one at each end of the 40ft cable and hook them up with an RS484 style differential link? Only need a twisted pair cable.

You make a good point.

22 Sep 2010

Haha.. Talk about overkill..

22 Sep 2010

user avatar Glenn Berden wrote:

Steve, Thanks for the reply. I totally spaced putting that info in my post. The PWMs will be filtered with a low-pass resitor/Capacitor to flatten it out and it will then drive the LM3914N on the 0 - 5 volt signal source pin.

Hello,

I took a look in the datasheet you linked to and found that when you just change one resistor in the reference voltage divider on the LM3914N you can change its input range from 0-5V to 0-3.3V.

Just look in the datasheet. R1 and R2 in the schematic on page 2. And the Vout formula on page 8.

Resistors are cheeper than mbed pins :-)

Art.

23 Sep 2010 . Edited: 23 Sep 2010

I'll look into it, Thanks

 BUt I don't remember reading anything about changin the input signal from 0-5v to 0-3.3.

Guess I should re-read it