Pial's (We)Blog

Hobby electronics, interesting findings on the web

This is a experiment with arduino and nokia 3310 display module. I downloaded the library from http://www.nuelectronics.com/estore/index.php?main_page=product_info&products_id=12. I got the display modules from eBay and made my own simple breakout board. This demo shows the time reading from a DS1307 time keeping chip. Also demonstrates how to display a graphic image and animation on the display using the library.

Here is how it looks:

Here is a video clip:

 

Here is the arduino sketch:

Nokia3310_Clock.pde (5.80 kb)

pacman.h (5.87 kb)


I recently wrote some code to drive a 4 digit seven segment display using the arduino and 74HC595 shift register chip. The display is a seven segment common anode display with decimal dots. The pin configuration can be found here. I have connected a DS18S20 temparature sensor to read the temparature and display the reading on the seven segment display.

Here is how it looks:




Here is the arduino sketch:

#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress insideThermometer;

//]\const int ledPin =  13;// LED connected to digital pin 13
const int latchPin = 5;//Pin connected to ST_CP of 74HC595
const int clockPin = 6;//Pin connected to SH_CP of 74HC595
const int dataPin = 7;//Pin connected to DS of 74HC595

const int digitPins[4] = {
  8,9,10,11}; //pins to control the 4 common anode pins of the display

const byte digit[10] = //seven segment digit bits
{
  B00111111, //0
  B00000110, //1
  B01011011, //2
  B01001111, //3
  B01100110, //4
  B01001111, //5
  B01111101, //6
  B00000111, //7
  B01111111, //8
  B01101111  //9
};

int digitBuffer[4] = {
  0};
int digitScan = 0;
int soft_scaler = 0;
float tempC, tempF;
int tmp;

void setup()   {                
  TCCR2A = 0;
  TCCR2B = (1<//pinMode(ledPin, OUTPUT); 
  for(int i=0;i<4;i++)
  {
    pinMode(digitPins[i],OUTPUT);
  }
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  

  sensors.begin();
  sensors.getAddress(insideThermometer, 0);
}

ISR(TIMER2_OVF_vect) {
  soft_scaler++;
  if(soft_scaler==15)
  {
    refreshDisplay();
    soft_scaler = 0;
  }
};  

void refreshDisplay()
{
  for(byte k=0;k<4;k++)
  {
    digitalWrite(digitPins[k], LOW);
  }
  digitalWrite(latchPin, LOW);  
  shiftOut(dataPin, clockPin, MSBFIRST, B11111111);
  digitalWrite(latchPin, HIGH);
  delayMicroseconds(400);
  digitalWrite(digitPins[digitScan], HIGH); 

  digitalWrite(latchPin, LOW);  
  if(digitScan==2)
  {
    shiftOut(dataPin, clockPin, MSBFIRST, ~(digit[digitBuffer[digitScan]] | B10000000)); //inserting the dot
  }
  else
  {
    shiftOut(dataPin, clockPin, MSBFIRST, ~digit[digitBuffer[digitScan]]);
  }
  digitalWrite(latchPin, HIGH);
  digitScan++;
  if(digitScan>3) digitScan=0;
}

void loop()                     
{ 
  //digitalWrite(ledPin, HIGH);
  sensors.requestTemperatures();
  tempC = sensors.getTempC(insideThermometer);
  tempF = DallasTemperature::toFahrenheit(tempC);
  tmp = int(tempF*100);
  digitBuffer[3] = tmp/1000;
  digitBuffer[2] = (tmp%1000)/100;
  digitBuffer[1] = (tmp%100)/10;
  digitBuffer[0] = (tmp%100)%10;

  //digitalWrite(ledPin, LOW);
  delay(20);
}


Download the sketch from the link below: 

SevenSegmentTest.pde (2.27 kb)

If you have any questions, please feel free to ask me via the contact link.


My 2002 Audi A4 key was worn out due to use and the clip that holds the two part of the key was broken last time when I was trying to replace the battery. Therefore I was looking for a replacement on eBay. I was not ready to go to the dealer as they usually charge $150 for a new key+remote and another $100 to program the immobilizer inside the key. I got a cheap deal on ebay for a used key that looked much much better than the one I had. Replacing the remote part in the new key shell was simple enough, as I decided to use old key's portion for the part where the remote chip is located. The chip is clipped to the plastic part using metal pins and it is not easy to take it apart without cutting the pins that hold it in place. But the bigger problem was to open the top part (part holding the flip key). First of all, it took me very long to find out using google that, there is a screw holding the two parts there which is located under the audi logo. I had to take the audi logo apart (it's pasted there using a adhesive connector). Then I was able to take the two parts apart, using a screw driver and a little bit of force. The most hard part was to remove the rfid transponder, that communicates with the immobilizer on the car, without that the new key would start the car, but the engine will shut off after 2 seconds activating the immobilizer. The immobilizer in my old key was pasted to the body using epoxy glue which took a lot of effort to take apart, but finally after a time consuming effort I was able to take it apart and place inside the body of the replacement key. I am just listing the resources that helped me to achive this, hoping it would help other DIYers out there.

http://www.audizine.com/forum/showthread.php?324553-How-do-you-remove-the-immobilizer-from-an-2002-b6-remote-fob

http://www.myturbodiesel.com/1000q_how_to/multi/immobilizer.htm

 




Control panel


Blogroll


    Archive