Generate character LCD images for illustration

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

The above are definitely not pictures I took on my LCD but look just like one, only much better. How did I make them? I have recently made a Phi-1 shield with 16X2 character LCD on it. Here is a way I found to generate perfect character LCD images for manuals. How did I make them? I used Word.

First install the Ericsson font from dafont lcd font page 7: http://www.dafont.com/theme.php?cat=302&page=7

Then in Word, type the message you want, and pad with enough characters so both lines are 16 characters. Say if you want “Read data list”, you want to type “Read data listaa”. Then select everything, then use green high lighter. Then choose the padding “aa”, use the same green as the font color so they will be invisible and all you see is “Read data list [2 spaces]”. Tada!

Here is more illustration:

Shopping trip with GPS logger

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

Now that I have built a GPS logger with my Phi-1 shield and arduino, I decided to take a trip to a local supermarket for a test run.

I used a car adapter (12VDC) to power my arduino. It took quite a while for the GPS to pick up signal, maybe because it was raining outside (raining in Minnesota winter? Really?)

Here is the map I got using GPS visualizer from http://www.gpsvisualizer.com

Everything seems nice although further zooming indicates that I “was driving on the other side of the road”. I guess commercial GPS does a lot of averaging to stabilize their readings. Next time I go to the cities I will carry it with me to record my trip for sure.

Fully functional Arduino GPS logger

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

There exist endless ways that you can use a GPS sensor in your projects. Geocaching and reverse geocaching are just two typical applications. Last time I made an attempt to use GPS with Arduino and my Phi-1 shield and it was a great success. The GPS sensor fits nicely under the LCD and I got lattitude and longitude readings of my home (checked on google map). This time I made up my mind to make it into a fully functional arduino GPS logger. It will feature a menu to choose from many functions including:

  1. Send data to PC
  2. Erase EEPROM
  3. Record GPS to EEPROM
  4. Display GPS coordinates on LCD
  5. Parameters

It took me more than one whole day, thanks to the winter break, to finish all the above and again provide the code freely to anyone that uses it non-commercially. If you use this commercially, come on! Don’t you think a whole day’s work deserve something especially if you’re planning to use it for montary gain? 🙂

Here’s some details:

Menu gives you several choices:
* Send to PC: sends recorded GPS information to PC via the USB connection.
Two modes are available:
Verbose mode generates information as shown below.
Non-verbose mode sends only the column labels followed by tab-separated data, ideal for spreasheet programs to import. You may copy and paste.
* Erase EEPROM: erases the EEPROM
* Record: records GPS information, lattitude, longitude, altitude, date, time, speed to EEPROM
* Display: displays the GPS coordinates without recording
* Parameters: allows the user to adjust parameters such as period between two consecutive recordings, PC data format, to start recording at which data entry and end at which entry.
* Up and down cycle through the menu options.
* Left, right, B act as confirm or enter.
* A escapes and only will preserve the latest value.

The verbose mode outputs human readable format but takes longer time as the USB link is only as fast as 115200BPS:

(I’ve blocked out the last 5 digits so you won’t find my exact location on map:)
Lat/Long(10^-5 deg): 45xxxxx, -94xxxxx Date(ddmmyy): 291210 Time(hhmmsscc): 5170500
Alt(cm): 33470 Speed(mph): 1.64

This is easy to read but very hard to import into a spreadsheet to analyze. So I added a non-verbose mode (choose under parameters). Here is its non-verbose output:

Lat(10^-5 deg) Long(10^-5 deg) Date(ddmmyy) Time(hhmmsscc) Alt(cm) Speed(mph)
45xxxxx -94xxxxx 291210 5170500 33470 1.64

(I’ve blocked out the last 5 digits so you won’t find my exact location on map:)
The above output can be copy+pasted to excel.

To make this GPS logger, you need the following:

Phi-1 shield kit from dipmicro.com

Arduino Deumilanove or Uno from sparkfun.com

GPS module from sparkfun.com

GPS connector from sparkfun.com

Here is the main page of the multi-functional Phi-1 shield, where you will find documentation, assembly guide pictures, and FAQs.

Here’s a picture of how to connect the GPS to the shield (only 3 wires are needed): If you have been following my posts, please make the change of wiring. On my last post, I used analog pins 0 and 1 to connect to the GPS. This was my first attempt and it cost me the two buttons B and A (since they’re using analog pins 0 and 1). This time I realized I only need one pin since I am not talking TO the GPS, rather, only LISTENING to it. So I am using pin 12 for this.

Here is a picture of the shield powered up and displaying menu:

Everything fits nicely together. Here is a side view:

Here is a video of the action: In the video I just went through the menu items and sent GPS data to PC. Next time I travel (even to work), I will take it and record my trip 🙂

Most importantly, the code:

Download code

TinyGPS library

NewSoftSerial library

A Phi-1 shield is needed. Please consider purchasing this multi-functional Phi-1 shield if you plan to prototype anything including LCD, GPS, clock, EEPROM, buttons, speakers, etc. I am sure you will enjoy it.

Connect Phi-1 shield with an EM 406A GPS

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

Have you thought of making a fun Geocache box for outdoor adventure or a wonderful reverse-Geocache box for friends or loved ones? Maybe you want a GPS tracker for field trips or position-sensitive projects? Yes, you can buy a GPS shield from sparkfun but then you also need other functions for your project, like an EEPROM to log positions and LCD with push buttons, then a real time clock in case your GPS loses signal. Maybe add a speaker. Then you need a bunch of shields. Asume they are all compatible with their pins (good luck if they’re made by different people), then as your shields stack sky high, so is your cost. 

My Phi-1 shield can solve this problem. It easily connects to a 16X2 character display onboard, 6 buttons, speaker and LED, real time clock, EEPROM, and GPS connector. The board design has a surface mount connector to incorporate an EM 406A GPS. But I have not been able to purchase a GPS module till recently so here goes how to add a GPS onboard and make this shield a multi-functional sweet tech pie 🙂

First, purchase a Phi-1 shield from dipmicro. I would go with the kit. If the kit is not available, just go down the page and purchase the items listed below. If the yellow LCD is not available, buy a different one. If the variable resistor is out of stock, buy another one like this. The only thing missing is an EEPROM. It really depends on how much storage you need. I use this but you can also buy the 1024KBit version for more space.

Then, purchase a GPS module and connector socket from a reputable vendor. I purchased mine from sparkfun:

GPS module:

EM 406A

Connector socket (to be soldered on the Phi-1 shield):

EM 406A compatible socket

I would purchase at least two of these sockets since they’re tiny and may get damaged if not soldered properly.

If you have not yet soldered your Phi-1 shield, make the above socket your priority. It is easier if you don’t have already soldered all parts that will be in the way when you solder this socket. If you have not handled surface mount components, google a few videos on how to hand solder them. I did it just by carefully soldering with a fine soldering iron tip and patience.

My suggestion: set the board on a flat surface. Put the socket on the board. Position the socket so that it is lined up with the solder pads. Make sure you get the right orientation. First solder the two side pins (possibly strain releif). Heat your iron, clean its tip, add very small amount of solder. If you see a solder ball forming on the tip, wipe it off. Then carefully place the tip on the solder pad and the side pin and hold it there for several seconds. Once you can see the solder start to move to the solder pad and the pin, hold a few moment and move to the other side pin. Occasionally the surface tension of the solder is large enough to drag the socket out of alignment. Just watch out for that.

Once the side pins are secure, check to make sure the solder pads on the PCB are lined up with the pins on the socket. Repeat with the minimal solder and hold the tip on the pin to solder all 6 connections. When done, inspect with a magnifying glass to make sure there is no shorting.

Now solder six female pins to the holes that break out the socket connection, just above the socket. Also solder the 5V and GND with female pins to its right (between the two channels on the right). This will make wiring extremely easy.

Now, wire the GPS as per picture:

Top pin to GND, 2nd pin to 5V, 3rd pin to analog 0, 4th pin to analog 1. You may use pins other than analog 0 and 1 and you need to change the definition in the code to reflect the change. These pins are used by the B and A buttons so you will no longer be able to use these buttons. If arduino has more pins, or you’re using the Phi-1 shield with mega board, go right ahead to use some unused pins.

Now, put some double sided tape on the botton of the gps module and tape it to the board, with the position and orientation indicated by the picture below. You should check clearance (avoid the metal in the red circle) by carefully putting the LCD back on the shield. If you get the GPS to the right location, the LCD should be slightly above the GPS but not touching it. I think I’m just that good of a designer 🙂

Plug in the GPS to the socket, observe that the grey line will appear on the right side, per the connections picture. Secure the connection.

Load the sample code. Make sure if you have changed which arduino pin the GPS is connected to, make change in the code as well. Power it up and wait. Nothing? Well, the GPS takes a while to start up and inside of a building is always going to be poor reception, especially on the first floor. I will try it in a car, with a 9V battery. Notice that the red LED on the GPS will flash at 1 second interval if it has a lock on the satellites. It is steady if it is powered on but has not locked on the satellites. Make sure you see the flash.

You can see the GPS module sits nicely underneath the LCD. The red color on the push buttons comes from the flashing light of the GPS indicator LED.

Here is a picture showing my GPS coordinate, and my El cheapo TomTom GPS with no reception. The coordinates are in 10-5 degree units.

Here is the code:

GPS basic display

Support library The newsoftserial and tinygps are needed for the code. These can also be downloaded at the author’s website. After you download the libraries, unzip them under your arduino sketch/libraries folder so that you will have something like arduino/sketchbooks/libraries/NewSoftSerial.

Your keyboard drawer greets you!

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

It’s been snowing almost all day today. I made this little fun program to pass some time.

This software will play a tune when you pull out your keyboard tray from your computer desk. It will play another tune when you push the tray back.
It’s perfect for some fun. I used the RTTTL code from Brett Hagman to generate a few tunes included in his original code. Nothing is modified from his code.
You can add a few tunes or sound effects if you prefer.
List of functions:
* Greets you with a tune when you set out to do some work on your computer, by pulling out your keyboard tray.
* Expresses farewell with a tune when you finish work on your computer, by pushing back your keyboard tray.
* TODO – display greeting message on LCD. Should be easy.
* TODO – add some sound effect tunes.
* TODO – add a menu to choose tunes from a list.

You will need to purchase a photo interrupter and breakout board from sparkfun.
http://www.sparkfun.com/products/9299
http://www.sparkfun.com/products/9322

You will also need a Phi-1 shield. A protoshield works too but no soldering is needed if you have an assembled Phi-1 shield.
http://dipmicro.com/store/JL-PHI-1-PCB
Make sure you purchase all the parts listed here:
http://dipmicro.com/store/JL-PHI-1

Solder everything per documentation.

Insert the photo interrupter in the pins 12, 11, 10, with 12 being the signal pin.

Tape a paper blocker to block the interrupter (notice the white paper blocker taped to the bottom of the table top), enjoy!

 

Here is a video:

Source code:

http://www.mediafire.com/?bgcx3h989fp8vnk

Phi-1 shield PCB is available for purchase

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

After the long waiting, it’s here!

If you’re interested in the projects and sample codes (Morse code, alarm clock, etc.) I posted here and want to explore more on Arduino, here is how to get the Phi-1 shield:

http://www.dipmicro.com/store/JL-PHI-1

The kit may take a day or two to appear in stock (it needs to be bagged) but it has a list of all parts you need so you can order all parts off that list!

How I soldered header pins for arduino shields

While I was soldering header pins on my Phi-1 shield for arduino, I’ve developed this technique. You can use this technique on most things that have male header pins. You will need two bare PCBs, or you may photocopy your PCB, use double-sided tape to tape the photocopy on a card, poke holes where male headers go. Now use masking tape to hold together the two PCBs or the PCB and the paper copy, sandwiching the male headers in between. Just use some masking take to hold the four corners tightly together. Once you do this, soldering is pretty easy. The pins will be up right, not tilted, or rotated. You can also use an arduino board to hold the pins, then stack the bare PCB on top and tape them together. Since the arduino female headers will conduct heat away, this needs longer time than using two PCBs or PCB and card. I will then use a third hand/holder to hold the board while I solder. If you don’t have a third hand, you can lay the board on a flat surface but sometimes it will wobble when you solder on a corner.

The soldering iron I used for this project was a portable battery-powered dual-setting iron from Weller. I’m experimenting whether this is a good idea. A corded iron has potential for dissaster in a student lab (burns, melting electrical cords and getting zapped). The iron claims to be able to solder up to 150 points. As of now, with the original batteries, I managed to solder about 75 points. I’ve done 60 with a new set of batteries. I’ll solder some more to find out how many more points I can solder with the remaining battery power.

Here’s some pictures:

Male pin headers are sandwiched between two PCBs.

I taped the four corners with masking tape.

Use a 3rd hand to hold the board when you solder.

Morse encoder and decoder

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine

This is an upgrade from my original Morse encoder/trainer.

I have added decode to the list of functions. Now you can try your skill with this program. Just key in (at 13WPM) with the A button on the Phi-1 shield and see Morse code (di and dah) display on the LCD. If you enter a valid sequence, the LCD will display the translated character. So if you key in …. . .-.. .-.. —, then the LCD will display HELLO. If you enter something wrong, just hang on to the key for two seconds or so then the last letter is erased.

The original Morse code player is unchanged, just enter a few words with up and down keys and play it.

I have also added a simple menu so you may select whether to encode or decode. Once you select encode, you can enter a few letters and play them. After they’re played, the program quits to the menu so you can choose decode and immediately practice your skill. I’ve learned about 10 letters and all the numbers now.

My next step is to put an adjustable parameter in the menu so you can choose the speed of the Morse code. I could use another weekend.

Here is a video (the decode, where I keyed in HELLO, took at least 5 trials. I need more practice 🙂

Where to get the Phi-1 shield?

You can purchase it at dipmicro, either just bare PCB, or kit (PCB + all parts). If the kit is not available (they need to be bagged), then scroll down and purchase everying on the list with the correct quantity, you’re set!

Code:

Morse code V6 



Morse encoder/player/trainer

I have had interest in learning Morse code for a while. It’s hard for me to start at this age but I’ve attempted to make a Morse code player already. See my early archives.

That was not very effective as a trainer. Now that I have the Phi-1 shield design, I decided to give it a second try, since yesterday afternoon. It went smoothly when I hodgepodged the original code with a other code that deals with display and text input.

I’ve added functions to my previous value input subroutines to handle both left and right arrows so I can jog my text cursor if I need to make changes. After pressing the enter, the input is sent to the Morse code subroutine and played out on the buzzer.

A few more things I’d like to do is to display the Morse code of the character being entered on screen and display the Morse code of the character being played on screen. I think I can savely leave these to interested individuals that want to do so.

I don’t even need a flowchart, the program is simple take input->play it->loop

Here’s a video:

Arduino alarm clock with Phi-1 shield

ATTENTION:You are reading an old post. The hardware and code mentioned here have long been upgraded.

Visit this link:

Phi-2 shield

I’ve thought about this for a while, make an alarm clock and be waken up by my own creation (I guess babies will do but they wake you too early).

I will need a real time clock chip (DS1307) to keep the time, arduino to display it on an LCD or LED matrix. I also need a buzzer to make some noise and a high-brightness LED to make flashy lights. Besides I need to program it so that it takes user input: adjust the time and date, set alarm with various settings “weekday, weekend, daily, once, off”. More importantly, I need to make sure a special key stops the alarm so I can get back to sleep!

Here is a flow chart of the alarm clock:

Well, let’s get to work. I’d like to get the “adjust clock” to work first. I know just the right tricks to do the job. I took a part of my other project, which is the human machine interface, added a few features, and poured it into the adjust clock and alarm. The functions simply take an initial value, its upper and lower boundary, and step. It renders the numbers or information and takes user inputs like up and down and confirm. It traps until the user finishes with the input and returns the entered value. The rest of the work is just labor.

The alarm function isn’t too hard either. You take an alarm time and compare with current time, then decide if the alarm criterion fits with the day of the week. I wrote a simple function within() to determine if the current day is within the alarm’s criterion, like Thursday is both daily and weekday.

The alarm isn’t too hard either. I picked a tone that is close to the clock I used years back and make it turn on and then off repeatedly four times. That was the alarm.

We will construct a fully-interactive arduino powered alarm clock with the following functions:
1. Displays the time and date
2. User adjustable time and date
3. User settable alarms with various settings “weekday, weekend, daily, once, off”, with buzzer and flashy led to wake you up.
4. More importantly, a special key that stops the alarm so you can get back to sleep!
5. Use the alarm function to power any shenanigans you want against your sleepy head 🙂
We will need the following parts:

Arduino Duemilanove or UNO

Phi-1 shield kit

We will need the following tools:
1. A soldering iron. Anything from radioshack will work just fine. I use a set that is $8 with the iron and a few tools including some solder.
2. 45 degree cutter for electrical cords, to trim after you’re done solder. You can buy one from radioshack or other places.
3. Optional third hand for holding circuit board. I can just lay the board down and solder it
4. Masking tape to hold down parts to be soldered

Code:

Alarm clock (buzzer and LED) This program is a fully-functional alarm clock. You will find it more complex than the basic clock. If you can’t understand, try the Clock display first.

For more information on Phi-1 shield, read its webpage!

Here is a video:

%d bloggers like this: