Blog Atom

Stop ACTA!

Like Richard Stallman, I support La Quadrature du Net. Do you?

ACTA is one more offensive against the sharing of culture on the Internet. ACTA (Anti-Counterfeiting Trade Agreement) is an agreement secretly negotiated by a small "club" of like-minded countries (39 countries, including the 27 of the European Union, the United States, Japan, etc). Negotiated instead of being democratically debated, ACTA bypasses parliaments and international organizations to dictate a repressive logic dictated by the entertainment industries.

ACTA would impose new criminal sanctions forcing Internet actors to monitor and censor online communications. It is thus a major threat to freedom of expression online and creates legal uncertainty for Internet companies. In the name of trademarks and patents, it would also hamper access to generic medicines in poor countries.

More on ACTA:

Posted in: lifefreedom

Tags: lifecommunityfreedomACTAdesasterinternetpolitics

Evaluating DS1626

I got some samples from MAXIM some few days ago. Since I was busy studying other stuff I had no time to give them a try. Today I tried the DS1626 Temperature Sensor.

It was very easy to setup in the Arduino environment using the SoftwareSerial library. One problem I had was, that I was not able to write the temperture to my LCD display. I could not figure out why this happens. The LCD code didn't worked anymore when including the SoftwareSerial header without using any functions of it...

Another problem for me was, that the DS1626 is being delivered in a SOP8 package and I for the first time needed to solder SMD. I used an adapter for SOP28 to DIP28 conversion because I wanted to place the IC on my breadboard. I soldered it successful and it worked right out of the box... ;)

Posted in: arduinoelectronicsDIY

Tags: arduinodeviceavrcircuitDIYelectronicslcdsensor

PC/SC for PHP officially released on the PECL platform

I am lucky to say, that my PHP extension for using Smart Cards based on the winscard API was successful released on pecl.php.net.It is designed for the use with the wonderful project PCSC-Lite for *nix. Since PCSC-Lite is implementing the API compatible to the PC/SC standard it should be possible to compile this code on other operating systems too.

I have created this extension in 2010 but needed to clean it up and do some long term tests. It runs nicely on some machines and now you are able to do Smart Card terminal prototyping using PHP. I am using this extension to run Smart Card devices on the server side for enabling communication with Secure Application Modules (SAM) / Hardware Security Modules (HSM).

The name of the extension is "pcsc". There is only a small subset of the API implemented but for most things this is enough. I will implement the full API at any time.

More information:

To checkout the code you need to execute the following command:

svn checkout http://svn.php.net/repository/pecl/pcsc/trunk pcsc

Thanks to the PHP developers who helped me doing this step and for commenting my code.

Posted in: opensourcesmartcards

Tags: phpopensourcelanguageaccountcodepcscprogrammingscmsmartcards

Arduino LM35 temperature sensor with LCD Display

I added my LM35 Temperature Sensor to my Arduino again and added a display to show how hot it is... ;)

I have used the LM35 already some month ago; It is a very easy to setup device.

Here is my Code (UPADTE 2015.08.21; This is my final code.):

// Written 2015 by Johannes Findeisen <you@hanez.org>

#include <LiquidCrystal.h>

// Initialize the LCD code. Take care of the pins I use. The first two pins 
// are 12 and 11 in most examples around the web. I use pin 7 and 6 because of 
// nicer wiring on my breadboard.
// Read this for more information:
// https://www.arduino.cc/en/Tutorial/LiquidCrystal
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

// Define how many samples should be collected every $collectDelay miliseconds.
// After sample collection the temperature is beeing calculated and then
// send to the LCD. 
int samples = 16;

// Collect delay between each sample. 
int collectDelay = 2000;

// The pin where the status LED is connected to.
int ledPin = 13;

// The analog input pin where the LM35 is connected to.
int tempPin = 0;

// Just some variable initializations.
float tempC = 0;
float tempClast = 0;
float tempF = 0;

void setup() {
  pinMode(ledPin, OUTPUT);
  lcd.begin(16, 2);
  // Get data for the first time.
  // Read this to understand the temperature calculation:
  // http://www.danielandrade.net/2008/07/05/temperature-sensor-arduino/
  tempC = (5.0 * analogRead(tempPin) * 100.0) / 1024.0;
  tempClast = tempC;
  // Celsius to Fahrenheit conversion
  tempF = (tempC * 9) / 5 + 32;
  // Refresh the LCD output
  lcd_refresh();
}

void loop() {
  int i;
  tempC = 0;
  for(i = 0; i <= (samples - 1); i++) {
    tempC = tempC + ((5.0 * analogRead(tempPin) * 100.0) / 1024.0);
    digitalWrite(ledPin, HIGH);
    delay((collectDelay / 2));
    digitalWrite(ledPin, LOW);
    delay((collectDelay / 2));
  }
  // Calculate temperature
  tempC = tempC / (float)samples;
  // Celsius to Fahrenheit conversion.
  tempF = (tempC * 9) / 5 + 32;
  // Print results to the display.
  lcd_refresh();
  // Remember current temperature for next run.
  tempClast = tempC;
}

// Prints results to the display
void lcd_refresh() {
  lcd.setCursor(0, 0);
  lcd.print("Temperature");
  lcd.print((char)40); // ASCII code 40 = "("
  if(tempClast > tempC) {
    lcd.print((char)60); // ASCII code 60 = "<"
  } else if(tempClast < tempC) {
    lcd.print((char)62); // ASCII code 62 = ">"
  } else {
    lcd.print((char)61); // ASCII code 61 = "="
  }
  lcd.print((char)41); // ASCII code 41 = ")"
  lcd.print((char)58); // ASCII code 58 = ":"
  lcd.setCursor(0, 1);
  lcd.print(tempC);
  lcd.print((char)223); // ASCII code 223 = "°"
  lcd.print("C/");
  lcd.print(tempF);
  lcd.print((char)223); // ASCII code 223 = "°"
  lcd.print("F");
}

Some other sources:

Have fun with it... ;)

Posted in: arduinoopensourceelectronicsdiy

Tags: arduinodeviceavrcircuitdiyelectronicslcdsensorcodeprogrammingboard

Pages