Can I connect two PWM pin together to increase my voltage? - Page 1
Forum section: electronics / beginners

author: zorthgo
author_rank: Regular Contributor
timestamp: November 09, 2012, 02:39:03 am
content: Hi Guys,I am working on a project for school and I have a question for you guys. I have a FreeScale M52233Demo board that works on 3.3V. I bought an LCD module from Parallax model #27979 that works on 5V. Can I by any change take two PWM pins from my microcontroller and put them together to increase the voltage to 6.6V or would that just fry my board? I did some googleling but I am not sure if it is safe to try it, and I definitely do not want to have to buy another LCD or board and wait another week to get it.Thanks for the help!

author: poodyp
author_rank: Regular Contributor
timestamp: November 09, 2012, 03:03:35 am
content: Electricity doesn't work that way. If you connect two 3.3v sources together you still get 3.3v. If you have two sources that are floating relative to each other you could connect them serially, but two outputs on the same chip aren't.What you need is a logic level shifter.

author: zorthgo
author_rank: Regular Contributor
timestamp: November 09, 2012, 03:28:58 am
content: Thanks poodyp for the reply! I guess I can't do that. I looked up logic Level Shifter and it sounds a little out of my league. I do however have a RadioShack battery box that can hold 4 AA batteries. Can you give me a hint as to how to drop those 6V down to around 3v? Thanks!

author: Jimmy
author_rank: Regular Contributor
timestamp: November 09, 2012, 03:36:58 am
content: To raise the voltage you will need a level shifter likehttp://www.freetronics.com/products/logic-level-converter-module#.UJx6PpFmOYQ

author: zorthgo
author_rank: Regular Contributor
timestamp: November 09, 2012, 04:01:26 am
content: Thanks Jimmy, But I think that device is if you would like to use a 3.3v sensor on a 5V microcontroller. In my case, I need to use a 5V LCD on a 3.3V microcontroller.Question: To reduce my 6V from the battery pack to 5V, can I use a voltage regulator? I remember going over them in Electronics I when dealing with rectifiers.Thanks!

author: mariush
author_rank: Super Contributor
timestamp: November 09, 2012, 04:16:10 am
content: Yes, you can use low drop linear voltage regulators.Pay attention to maximum drop voltage (you should be safe with up to 0.6-0.8v, this way voltage should be regulated to 5v even when battery goes a bit below 6v). Then pay attention to maximum current the regulator can handle - a sensor would work with a 100mA regulator but for a LCD panel you're safer with a 250mA or higher regulator.For example:http://uk.farnell.com/microchip/mcp1700-5002e-to/ic-v-reg-ldo-250ma-to-92-3/dp/1331481http://uk.farnell.com/microchip/tc1262-5-0vdb/ic-ldo-500ma-5-0v-sot223-3/dp/1852185http://uk.farnell.com/microchip/mcp1703at-5002e-mb/ldo-2-7-16vin-0-25a-5v-2-3sot89/dp/2218577http://uk.farnell.com/on-semiconductor/ncp5501dt50g/ic-voltage-regulator/dp/1703369http://uk.farnell.com/microchip/tc1262-5-0vab/ic-ldo-5-0v-500ma-to220-3/dp/1852184http://uk.farnell.com/microchip/mcp1825s-5002e-ab/ic-ldo-5-0v-500ma-to-220-3/dp/1578405Should find the chips somewhere else like digikey, just search for the base name like "mcp1700" , "5501" or "ncp5501" , "tc1262" etcYou'll find similar chips that have fixed output for 3.3v in case you don't use a linear regulator already. Or you can use something with adjustable voltage output and use two resistors to set the output voltage.I'd suggest connecting the 3.3v regulator in that case to the 5v linear regulator output, this way the losses are smaller and the battery should last longer.battery ->6v to 5v linear regulator (250mA - 500mA or more)-> lcd-> 5v to 3.3v linear regulator (100mA - 250ma, doubt your microcontroller uses more than 100mA)Read the datasheets, all should have basic circuits which tell you what capacitors you should use and where, linear regulators are very simple.

author: free_electron
author_rank: Super Contributor
timestamp: November 10, 2012, 01:08:24 am
content: driving the 5 volts lcd from the 3.3 volts cpu should not be a problem. the output voltage high (VoHmin) of the cpu is high enough to be seen as a logic '1' by the 5 volts display .as long as you are only driving the display there is no problem

author: Psi
author_rank: Super Contributor
timestamp: November 10, 2012, 02:12:57 am
content: You could generate a Q and "not Q" square wave using two 3.3V io pins and feed it into a diode cap voltage multiplier.That would give you 6.6V, add a 5V zener and you would have ~5V.Then you'd need to- Put a resistor divider on every 3.3v mcu input so it could accept 5V from the LCD- Add a transisor for every 3.3v mcu output to switch 5V to the LCD.But, as others have said, use a level shift IC. Its far easier and simplerOr you could forget active level shifting and just add voltage dividers on all 3.3V mcu inputs.The 3.3V mcu outputs will probably be accepted by the 5V lcd correctly.It's not good practice but most of the time it works for hobby stuff.

author: notsob
author_rank: Frequent Contributor
timestamp: November 10, 2012, 02:26:35 am
content: If you are not aware of this, you can get 3.3volt LCDs, even sparkfun has them in stockhttps://www.sparkfun.com/products/9053

author: zorthgo
author_rank: Regular Contributor
timestamp: November 10, 2012, 02:40:07 pm
content: Thanks guys for the replies!I bought a 5V voltage regulator at radioshack but unfortunately it drops my 6.6V to 4.5V instead of 5V, and the LCD doesn't even light up. I plugged the 6.6V into the LCD and ran the self test on it and it displayed the initialization text and sound correctly. Which leaves me with the following question. Would it be ok if I ran it at 6.6V since is seems to be working correctly or is it slowing killing my LCD? Also, I am sending the Asynchronous Serial signal to the LCD (I can see the signal on my oscilloscope) at the correct baud rate, but the LCD doesn't display anything. Could that be because of the 6.6V I am applying to the LCD? Thanks for all the help!

author: zorthgo
author_rank: Regular Contributor
timestamp: November 10, 2012, 02:43:09 pm
content: Hi Jimmy, in the description of the link you sent me it says that the level shifter is for using 3.3V sensors with a 5V MP. Would it also work in reverse?

author: zorthgo
author_rank: Regular Contributor
timestamp: November 10, 2012, 04:26:35 pm
content: Ok, I think I might have killed my LCD module.At 6.6V, I couldn't get anything to display on the screen when sending data from the MP, so I decided to use my variable power supply to supply the necessary 5V to the LCD screen. Now when I send data at 19200 baud, I get garbage on the LCD screen (at least I am getting something). When sending the signal using the other two speeds (2400, 9600 baud) I still get nothing. Do you think that I might have killed an internal component on my LCD screen like the timing crystal causing the serial communication to be off sync? Is there any way I can test that? Any help would be appreciated.Thanks!Zorthgo

author: Bored@Work
author_rank: Super Contributor
timestamp: November 10, 2012, 04:53:10 pm
content: The module has an own test mode, did you use it?The module has baud rate switches. Did you change them?

author: zorthgo
author_rank: Regular Contributor
timestamp: November 10, 2012, 06:52:25 pm
content: Hi Bored@Work,Yes, I ran the self test and it displays the test text string on the screen and plays the sound. I did change the baud rates to all three speeds (and configured the MP to send the data at those speeds). But the only baud rate that I get anything displaying on the screen is the 19200, and even then, it is garbage data. When I set the baud to the lower speeds, I get nothing on the screen. At 6.6V I get nothing on all baud rates.

author: Psi
author_rank: Super Contributor
timestamp: November 10, 2012, 07:14:32 pm
content: 5v devices often have an "absolute maximum rating before damage" of 6 - 6.5VIt should be in the datasheet

author: zorthgo
author_rank: Regular Contributor
timestamp: November 10, 2012, 11:42:00 pm
content: Ok, I checked the datasheet up and down. The only specification is the operating voltage (which is a fixed 5V not a range). I've been working on this thing for the last two days without any luck (that's what you get for trying to go beyond what the teacher has taught). I guess I will have to take it in to my teacher to see if he will help me with this (or at least tell me if the LCD is dead).But thanks for all the help. I will try some of the things you guys suggested for the power supply (probably the voltage divider), so that I don't have to lug my bench top power supply with me when I have to deliver my presentation on the project.Thanks!Jay

author: Psi
author_rank: Super Contributor
timestamp: November 10, 2012, 11:47:50 pm
content: The datasheet will have an operating voltage but also in another section will be table for"Absolute maximum ratings".

author: zorthgo
author_rank: Regular Contributor
timestamp: November 15, 2012, 12:15:34 pm
content: Hey guys, After almost a whole week tinkering with this stupid LCD, I found out I was the one being stupid. Apparently because my board and the LCD had different grounds, they were not able to communicate serially. This was very exciting because this is the first time that my oscilloscope actually helped me learn (and debug) something. Now that I connected both my LCD module and my MP board to the same power source, they are communicating with each other perfectly.Would anyone be so kind as to explain to me why they have to be connected to the same power source? Also, why do I need to plug my oscilloscope to the circuit's ground? I noticed that when I didn't plug my oscilloscope to the circuit's ground instead of seeing the square wave of my serial signal, it displayed the square wave of the signal ridding on something that looked like a sine wave.Thanks guys for all the help! O0

author: Psi
author_rank: Super Contributor
timestamp: November 15, 2012, 12:35:20 pm
content: Quote from: zorthgo on November 15, 2012, 12:15:34 pmHehe, we've all done that.Quote from: zorthgo on November 15, 2012, 12:15:34 pmThey don't need to be powered from the same supply but they do need to have a common ground. Otherwise it's like a lightbulb with only one wire connected to power.If you want one device to communicate with another then current needs to flow between. If you only connect the signals wires there's no current flow.Quote from: zorthgo on November 15, 2012, 12:15:34 pmThe scope is always grounded to mains earth. So any measurement it displays is with reference to mains earth.It's likely there was actually some ground connection between the scope and your circuit (even with the scope ground clip unplugged) due to mains earth getting to your circuit through some other means. It probably had to travel through half the mains wiring in your house and back again and as a result the signal quality is terrible and you get 50/60hz mains noise superimposed on top.Even if there was definitely no earth connection to your circuit it would have been earthed somewhat just by capacitive coupling to nearby earthed objects. The scope input is high impedance so will pickup stuff like that without a proper ground.Also things start acting like an antenna without an ground.

author: zorthgo
author_rank: Regular Contributor
timestamp: November 15, 2012, 05:21:53 pm
content: Thanks Psi! That was very insightful.Your explanation on the oscilloscope made perfect sense to me. I do have a question though. What do you mean when you say "common ground"? If I power one device from a 5V lab powersupply and the other from a 5V battery do they have a common ground? If not, is it because the battery's negative is isolated from the other system?Thanks!

author: T4P
author_rank: Super Contributor
timestamp: November 15, 2012, 06:07:52 pm
content: Common ground is when the grounds are linked together. That's the simplest explanation i hope you will understand

author: zorthgo
author_rank: Regular Contributor
timestamp: November 15, 2012, 06:35:33 pm
content: Thanks T4P! That was simple enough.But I still have a question. My asynchronous serial connection between my developer's board and my LCD module didn't work because they did not have a common ground. But how come I can talk to a serial device using my laptop' serial port (which is running on it battery, therefore not a common ground). Shouldn't the serial device be required to have a common ground with the laptop? How does that work?Thanks for the help!

author: Thor-Arne
author_rank: Unknown
timestamp: November 15, 2012, 07:24:51 pm
content: Quote from: zorthgo on November 15, 2012, 06:35:33 pmThe laptop's ground is connected trough cable to your serial device's ground, so they have common ground.The meaning of having a common ground is for the devices to have a common reference point so they can "understand" each others signals.Common ground does not necessarily mean the mains ground, think of it as 0 volt point in the circuit.

author: zorthgo
author_rank: Regular Contributor
timestamp: November 15, 2012, 09:03:17 pm
content: Now it makes perfect sense! That is why on serial cables you have the ground pin. Thanks Thor-Arne!

author: T4P
author_rank: Super Contributor
timestamp: November 16, 2012, 12:07:46 am
content: That's also why you have ground pins on ... everything. Signal transmission does not work magically (i.e having no 0V to reference 'LOW' to)

author: ptricks
author_rank: Frequent Contributor
timestamp: November 16, 2012, 12:49:22 am
content: Quote from: zorthgo on November 15, 2012, 09:03:17 pmThe outer shell of the serial cable connector are also ground points.