Close
0%
0%

NANO-4096

An easy to build Arduino based gaming device with 101x80 pixel 4096 color LCD, 8 buttons, sound and SD card.

Similar projects worth following
This small handheld is build around cheap breakout boards that are readily available on eBay. The LCD used is a Sharp LM15SGFNZ07 found in old Siemens mobile phones. Mine comes from my old MC60 phone. I wrote a little library to control it over the SPI bus.

I'm still working on a demo game for the system which will be a port of the old DOS game Heartlight.

System features are:
* 4096 color, 101x80 pixel LCD screen from an old mobile phone.
* SD card for file storage. The demo game will store the levels, title screen and player progress here. The game code itself must be burnt onto the Arduino.
* 4 direction buttons and 4 action buttons connected to 3 analog inputs.
* Small piezo speaker to play tunes and sound

I designed this handheld around the Sharp LM15SGFNZ07 LCD that I found in my old MC60 phone. A while ago I wrote an Arduino library to control this screen using SPI. I based my implementation on code by Mindogas which was too slow to be practical but gave some excellent insights on how the LCD should be controlled. The LM15SGFNZ07 has a total of 4096 colors and a rather strange resolution of 101x80 pixels.

When I had my library finished I thought it may be fun to try and make my own handheld gaming thingy (it doesn't have a name yet). I wanted it to use cheap parts that are easy to hook up together. So the cost are kept to a minimum and it should be easy enough to build for most hobbyists. The LCD is probably the hardest to come by, but it can be salvaged from scrapped Siemens phones (A65, M55, C60, MC60, S55, A60).

To play tunes and sounds I wrote a little library that I like to call 'Auduino'. It takes a string that defines the tune and plays it in the background. The syntax of the tune string I based on what is common in, among others, Qbasic. For example "T160O4CDEPL8FGAPL16B>CD".

The way the buttons are connected came without putting much thought into it. I planned to connect each button to a digital input, but while soldering I though that it may be better to connect them to an analoge input to save some pins. So there is no real logic in the analoge values assigned to the buttons. The joystick is supposed to be a fully analogue stick, however the range is very small and maxed out about half way from the center. For that reason it's implemented as digital up, down, left, right in the software.

What's still left to do on this:

  • Compile all loose bits and pieces of code into a library that can be used with the system
  • Strip down the standard SD library so it only contains the bare minimum and there is more space left for the actual program
  • Complete the demo game Heartlight (and maybe write some more?)
  • Attach a battery
  • See if I can 3D print a case for it

  • 1 × Arduino Nano USB Nano V3.0 ATmega328 16M 5V Micro-controller CH340G board For Arduino
  • 1 × SD card breakout board Micro SD Storage Board Mciro SD TF Card Memory Shield Module SPI For Arduino
  • 1 × LM15SGFNZ07 LCD screen 4096 color 101x80 pixel LCD found in Siemens A65, M55, C60, MC60, S55, A60 phones.
  • 1 × Piezo speaker
  • 8 × Push button

View all 10 components

  • I name thee NANO-4096

    Maarten Janssen01/31/2016 at 16:56 0 comments

    I finally came up with a name for the device: The NANO-4096. The past two weeks I've spent more time on the code. I decided on using the SdFat library for SD card functions. It's slightly more compact than the standard Arduino SD library. I've also finished the demo game Heartlight! The levels file from the original game is read from the SD card which means that all 70 levels from the original game are playable on the NANO-4096 :D. It needs a little more polish, for example being able to select a level and a real intro screen, before I'm fully satisfied with it. There is still 5kb left for these features, which should be plenty.

    I've also decided to ditch the analogue stick. It was making the device quite bulky and the analogue travel of the stick was almost non existent. So I've replace the stick with four buttons. Still the X and Y-axes are hooked up to separate analogue inputs (A0 and A1 respectively) allowing the player to press two direction simultaneously. This change lead to me making a new prototype on a slightly bigger board. Build instructions on this page still need to be updated and I will provide a video soon of the NANO-4096 in action playing Heartlight.

  • A week's worth of updates

    Maarten Janssen01/16/2016 at 14:15 0 comments

    • Heartlight is almost complete! :) I've been programming this week to add the last missing game elements such as transport blocks and I've added viewport scrolling so the entire level can be explored. I'm now able to play individual levels of the game :D. Loading levels from the SD card is still missing...
    • On that topic... I haven't found a good replacement for the SD library (yet). The ones I tried didn't work or didn't give any real improvement on code size. So for now I'm sticking with the standard Arduino SD library and optimizing my code to fit everything in memory.
    • On the hardware side I've added a 1uF capacitor between D7 and the speaker. This prevents the screen flashes that would occur when a sound was being played.
    • I'm not sure whether I will keep the analog stick. It's not very useful and if I replace it with tactile buttons it will make the unit less bulky.

View all 2 project logs

  • 1
    Step 1

    • First solder the headers onto your Arduino Nano board. Notice that I soldered the ICSP header onto the bottom since I'm using it to solder the serial lines of the LCD to.
    • If your joystick and SD card breakout boards come with angled headers, like mine did, then replace them with straight headers.
    • Cut the perfboard down to 39x18 holes
    • If you got a cheap Nano clone like I did then don't forget to flash the Arduino bootloader. Instructions found here: http://www.instructables.com/id/How-To-Burn-a-Bootloader-to-Clone-Arduino-Nano-30/
  • 2
    Step 2
    • Screw the spacer onto the SD card board.
    • Solder the Arduino and SD card breakout onto the perfboard. Notice their placement in the image.
    • Solder the VCC (5v) and GND lines of the SD breakout board to the Nano
    • Complete the data lines of the SD board:
      • CS to D3
      • SCK to D13 or ICSP3 (I connected the data lines to the digital pins of the Nano to make my life a little easier since I have the LCD connected to the ICSP header)
      • MOSI to D11 or ICSP4
      • MISO to D12 or ICSP
  • 3
    Step 3
    • Solder the pushbuttons and resistors onto the perfboard as shown in the image. Shared pins of the buttons go horizontal.
    • Complete the connections of the buttons and the resistors.
    • Common button pins go to A2, series resistors go to GND

View all 6 instructions

Enjoy this project?

Share

Discussions

davedarko wrote 09/15/2017 at 13:14 point

I just found one of these displays in a drawer, thanks for sharing! :)

  Are you sure? yes | no

Daniel Riches wrote 12/13/2016 at 07:21 point

Very nice work, I want to do something like this with an ESP8266 after finishing my Gamebuino hacked into an Arcadie which is my Christmas project with my 9yo son. :)

  Are you sure? yes | no

Michał B. wrote 11/08/2016 at 21:18 point

I have the same exact display and used it with the ESP8266 with minor library tweaks and SPI clock bump to 35 MHz (which really made a difference).

Is it as dim as it seems on the photo? Mine also is. However, despite being black in unpowered state it's quite well visible in sunlight, so it's not that bad.

  Are you sure? yes | no

Maarten Janssen wrote 11/08/2016 at 21:51 point

The display is indeed a bit dim and also the colors are not as vivid as on a modern LCD. But hey like you said it's not too bad.

Having a 35 MHz SPI clock would really make it fly :). I was already impressed that I got a good frame rate in the game with my little Arduino.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates