More Analog Pins

06 Sep 2012

Hi, using an mbed-NXP-LPC1768. Currently I have all Analog pins (p15-p20) of the mbed in use for a 16x2 LCD screen (lcd: reset, enable, and 4 input pins). I have a 3 wire (power, gnd, analog) temperature sensor I would like to interface with the mbed. So several questions arise: Is it necessary to use the analog pins for the LCD? if so, can you define an unused pin to be analogin?

06 Sep 2012

The LCD wont need to use the analog pins, so you can change that (depending on the library you use). You cant define a pin that is not an analogin pin as analogin pin, it is simply physically not possible. Another option would be getting a digital temperature sensor.

06 Sep 2012

Erik - wrote:

The LCD wont need to use the analog pins, so you can change that (depending on the library you use). You cant define a pin that is not an analogin pin as analogin pin, it is simply physically not possible. Another option would be getting a digital temperature sensor.

That is what I thought for defining pins on the mbed, that I was restricted to the 6 analog. I am using a modified version of the TextLCD (several of the library offsets and constants were modified for my specific LCD16x2 display).

http://mbed.org/cookbook/Text-LCD

I will look into switching the LCD to the digital pins (I used the analog because they were the default listed on the page above).

06 Sep 2012

Thats what I thought about the textLCD class, you can define any pins you want for them, there is no need to stick to the analog pins. So yeah, just switch them.

29 Nov 2016

I need some information about analogin pins in lpc1768 to interface with mq7 sensor and GSM

29 Nov 2016

For the A/D characteristics - start on the mbed site - https://developer.mbed.org/platforms/mbed-LPC1768/ and find the section where you can get the schematics and data sheets. In there you'll find the a/d should not exceed 3.3v for an accurate reading.

I've not used the mq7 sensor, but after a quick search I found these pdfs on the sparkfun site - https://www.sparkfun.com/datasheets/Sensors/Biometric/MQ-7.pdf https://cdn.sparkfun.com/datasheets/Sensors/Biometric/MQ-7%20Ver1.3%20-%20Manual.pdf

A few things I interpret from them - 1) you need to drive it from a 5v supply and alternately from a 1.5v supply. 2) you need to pulse the heating input circuit (to 5v for 60s and to 1.5v for 90s) 3) the sensor output can exceed 3.3v of the analog inputs so you need to scale that down

I also noticed elsewhere on the sparkfun site a simplified schematic that did not pulse the heating circuit. That would appear to be a violation of the recommendation in the data sheet.

Offhand, I think a simple programmable voltage regulator might do the trick to alternate between 5v and 1.5v, and a simple resistive divider from the sensor to the a/d would handle the 5v to 3.3v conversion.

And I've not done anything with GSM - perhaps others will help out there.