3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Arduino: Nokia LCD & Sensors

Arduino: Nokia LCD & Sensors
Arduino: Nokia LCD & Sensors

PROBLEM: Making my Arduino, a Temperature-Relative Humidity sensor and a Nokia3310LCD screen work together.

Now, I’m a Lazy Old Geek, so what I wanted was an Arduino kit that would take shields. This Freeduino was the cheapest that I could find at the time.
http://www.seeedstudio.com/depot/freeduino-usb-complete-kit-p-58.html?cPath=79_82

Since I was at Seeedstudio, I also ordered an HSM-20G Temp-RH sensor as it was on closeout and I needed something to try out my Arduino with. Seeedstudio no longer carries these and they’re hard to find. But here’s one site that sells the HSM-20G. 
http://www.emartee.com/product/41488/#

My dog, Marcus and I walk every day, so I decided I needed a portable Arduino to display Temp-RH on our walks. My display choice was the Nokia3310LCD shield. Plus it has a cool, little joystick on it.
http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=12

So here’s the problems and processes I went through to make it all work.

Parts:
USB Freeduino kit      $22
HSM-20G Temp-RH   $9 (Closeout)
Nokia3310LCD           $14.99

Prices US dollars August 2010
 
 
Remove these adsRemove these ads by Signing Up
 

Step 1Connecting the HSM-20G

Connecting the HSM-20G
«
  • HSM-20G.jpg
  • HSMG20Schematic.jpg
  • HSM20G.JPG
Here’s the suggested interface circuitry for the HSM-20G. See picture.

Problem 1: The Nokia3310 shield fits on the Freeduino but I didn’t want to connect the HSM-20G to the shield. There’s only three components in the interface but I didn’t have a protoshield or any prototype area on the Nokia3310LCD shield, so I decided to build the interface onto the HSM-20G PCB. This is reasonable as it will always be needed whenever I used the HSM-20G. So I soldered the 10K to the T output and to a ground on the top side of the PCB. See picture.
Caution: This method is not recommended for the inexperienced.
A ground pin can be found by following the Ground (-) on the connector and tracing it on the PCB. The best way to verify that it is ground is to set your DMM to ohms and measure between the (-) pin of the connector and the pin you suspect is ground. It should be shorted (less than an ohm).

Problem 2: Well, I didn’t have a 47uFd capacitor, but I scrounged a 22uFd capacitor from some scrapped printer PCBs. I can tell from the documentation, that all the capacitor does is smooth out the Relative Humidity voltage, so 22uFd should work just fine. So I solder the capacitor to the 100K resistor, then soldered the resistor lead to the H pin on the connector making sure the positive side of the electrolytic capacitor is on this side. Then solder the other side of the resistor to the 10K resistor lead that is soldered to ground. See picture.

Make sure all of the leads aren’t touching other components and there are no solder bridges.

Problem 3: There was no mating connector for the HSM-20G module or a part number. I emailed Seeeduino requesting the brand and part number and of course got no response. But I scrounged through my junk pile and found a connector that worked.

Problem 4: How do I connect it to the Arduino? The preferred way would be to get one of those stackable protoshields and connect the HSM-20G to it. You could also put the interface circuitry on the protoshield. But I didn’t have one.
NOT RECOMMENDED: So I soldered the connector directly to my Freeduino. The (+) goes to a 5V connection. The (-) goes to a ground. The ‘H’ connects to Analog 1 and the ‘T’ to Analog 2.

Caution: When connecting two different sensors or shields, you have to be careful about not overlapping Analog and Digital pins. I started an Excel spreadsheet that has all of my shields and the pins they use. The Nokia3310 shield uses Analog 0 for the joystick so Analog 1 and 2 are available for the HSM-20G.

Here is the site where I found the sample HSM-20G sketch. This person really seems to know what he’s talking about. I verified the formulas with the HSM-20G data sheet. They are very accurate. There are other sensor interfaces on this page, also.
http://sites.google.com/site/measuringstuff/more-sensor-examples#TOC-HSM-20G-Humidity-and-Temperature-Mi

So I was able to run this sample HSM-20G sketch and display temperature and humidity on the PC monitor.
 
« Previous StepDownload PDFView All StepsNext Step »
14 comments
Feb 2, 2011. 6:42 PMbeverageexpert says:
I am trying to hook up a nokia 5110 that is supposed to be the same pin mapping. Is this the pin mapping that the shield uses?

#ifdef PB1
#define LCD_RST PB1
#define SPI_CS PB2
#define SPI_MOSI PB3
#define SPI_SCK PB5
#define LCD_DC PB0
#define LCD_BL PD7
#else
#define LCD_RST PORTB1
#define SPI_CS PORTB2
#define SPI_MOSI PORTB3
#define SPI_SCK PORTB5
#define LCD_DC PORTB0
#define LCD_BL PORTD7
#endif

which when translated for the arduino pins this is how I believe it should be set
LCD_RST digital pin 1
SPI_CS digital pin 2
SPI_MOSI digital pin 3
SPI_SCK digital pin B5
LCD_DC digital pin 0
LCD_BL Pdigital pin 7

am I missing something?

Nov 14, 2010. 3:56 PMNick_de says:
Very well written! Nice and detailed!
Oct 22, 2010. 12:46 PMpatenaude says:
Do you have any experience getting this display shield to share the SPI bus with other shields? I'm trying to get it to play nicely with a Freetronics ethernet shield (which unlike most w5100 based shields, honors the cs line).

-- Mitch
Sep 30, 2010. 10:01 AMice_k99 says:
I can tell that you are a very organized, grammatically correct, and SMART, lazy old man. You speak my language and I love how you actually got the results that you desired, good work, very resourceful and patient. Paying attention to the smaller details was always a key highlight in engineering.

To add furthermore on to your very eloquent and detailed instructable that you have created I would also like to add one small tidbit to your comment on discarding the first reading from the modified AnalogReference() id.

Your tip that explains not to include the first reading ( and I am speculating, I have never used an arduino or any of the devices listed here ) most likely is due to two consequences. Firstly, when you plug a device into any battery or power source, there will be an initial "pulse" high energy output that comes from the power source. One can interpret this as the phenomenon of kinetic energy from physics, i.e. - there are two different equations for the initial (or static) state of energy and when the energy is in motion. Molecules are put into a state of havoc then ultimately into a more steady state of flow, thus explaining the two different equations. Different batteries and alternative power sources that I know of have different "pulse" currents that initially "pulse" out, just like the Silver Surfer character in the second "Fantastic 4" comic movie. Secondly, the initial reading would be tossed out ( again here, speculating ) because the unit, when modified, might not use the same algorithm as the normal, debugged input. It might not be compensating for the initial "bounce effect", i.e. basketball effect of when a button is pushed. Digitally speaking, this means that whenever you are typing on your keyboard or pushing a button, there is a microcircuit with an algorithm automatically compensating for the impossibly small bounce that sends multiple "1's" to your next device. To fix this, the algorithm simply is written to ignore the initial bounce gap interval of "1's" and set the gap interval of "1's" to just plain and simply "1". That's it, and everything runs smoothly.

Did my comment overcompensate the "geek" effect in this article? ;)

I hope someone here understands it and appreciates it.

-Keith
Sep 30, 2010. 2:15 PMice_k99 says:
Well, it would appear that you are still as sharp as a tac! I get what you are saying by the initial "startup" states in your pdf now that you explained it.

I took 4 years of physics and 2 1/2 of electrical engineering, along with another 2 1/2 of advanced math and statistics/finance/economics courses. Let's just say I wanted to get the most for my money out of college ^^ :).

As far as the "not understanding" part, I was merely referring to patterns I saw while reading your statements in this instructable. There are many equations and laws of physics which can be referenced and applied to the problems that you were having, and apparently already knew of. I just found it fascinating that someone would actually put in as much work as you did in writing an article - and yes, I do appreciate it very much! I learned a lot from your article and it brought back memories from when I used microcontrollers and programs to implement circuit functions (and the headaches!!). But as you say, it is very hard work. I certainly wish I had you as my teacher instead of foreigners with thick accents that I could not even understand!

The capacitors are there to compensate for delay like you said and to provide open/close switch circuit operations for different "states" of digital electrical "time frames" - so to speak. For any given output at any given time, there must be a programmed circuit (both hardware and software) to fulfill all of the different combinatorial digital circuit logic functions that one may want, therefor, one must acquire capacitors and transistors to provide for those exact functional outputs. It is indeed very complicated and I did not want to pursue that stressful environment. The capacitors are almost always coupled with transistors in any circuit due to our "digital age".

ON....OFF....ON....OFF....etc...

The capacitor takes care of one part and the transistor takes care of the other. They pretty much work hand in hand, different properties and such with AC and DC current. I'm a sucker when it comes to "why" these things work the way they do. Technology is unbelievably mind boggling, it is very cool to see how you "hacked" the device to work for you and the very hard work you put into it to make it precisely the way you wanted it to be. I still could look at a circuit diagram drawing now and get lost in less than a second, and I'm only 26!! lol.

I make LED toys now ;). I've been working on new designs for over a year now and I am trying to start up a small business. I'm a geek too :).

Do you have any other instructables online?
Sep 30, 2010. 10:06 AMice_k99 says:
Very cool btw, this must have taken you F-O-R-E-V-E-R! I appreciate the time that you spent to put together the grammar, organization, detailed information, and dummied down explanations. Your perspective writing is very well written and you have a keen sense of situational awareness. Very refreshing.
Sep 28, 2010. 8:20 AMkhalidkhattak says:
(removed by author or community request)

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
47
Followers
33
Author:msuzuki777
Lazy Old Geek