Archive for the ‘programming’ Category
PC/SC for PHP officially released on the PECL platform
Tuesday, December 13th, 2011
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: account, code, hacking, language, news, opensource, pcsc, php, programming, scm, smartcard
Arduino LM35 temperature sensor with LCD Display
Sunday, December 11th, 2011I 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:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
float temp;
int tempPin = 0;
void setup() {
lcd.begin(16, 2);
lcd.print("Temperature:");
}
void loop() {
temp = analogRead(tempPin);
temp = temp * 0.48828125;
lcd.setCursor(0, 1);
lcd.print(temp);
delay(1000);
}
Some other sources:
- Arduino LM35 Sensor
- Temperature sensor tutorial – Using the TMP36 / LM35
- Temperature Sensor + Arduino
Have fun with it… ;)
Posted in: arduino, avr, board, circuit, code, device, diy, electronics, hacking, lcd, programming, sensor
Arduino LM35 temperature sensor
Monday, April 11th, 2011I am ill today and needed to distract me some bit.
I added a LM35 temperature sensor to my Arduino. Since someone did the work already, I only needed to copy some code and setup the wiring on a breadboard. I used the same wiring like in the link. Below is an image of the wiring made with Fritzing. I am using a LM335 for this because there where no LM35 as a Fritzing part available…

I changed some parts of the code to only print the temperature as String to serial. In the original code the data was sent as (byte) over serial to read the value with an application created using Processing. Feel free to change this again… ;) This is the code I used:
float temp;
int tempPin = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
temp = analogRead(tempPin);
temp = temp * 0.48828125;
Serial.println(temp);
delay(1000);
}
My output in the serial monitor of the Arduino IDE looks like this:

Posted in: arduino, avr, circuit, device, diy, embedded, fun, hacking, news, opensource, programming, sensor, wiring
Alex’ Tiny2313 Header Board
Sunday, April 10th, 2011I got this nice Tiny2313 header board on Friday from Alex. Thanks for that nice piece of work!
It seems that I bought the last ones because there are currently no more of them in his shop available… :( But I think you could get one in the near future again. If not take a look at his site. All code and schematics are freely available there.
Soldering was a lot of fun and very easy to do. After successful soldering I build the small circuit at the end of the howto and flashed the microcontroller using the Makefile provided by Alex. I needed to change some things to make it work right on my Linux box using avrdude and the Atmel AVRISP mkII.
I changed the PROGRAMMER line to:
PROGRAMMER = -P usb -c avrispmkII
If you even get errors, try to add the parameters “-F” and “-D” to $PROGRAMMER. Call “avrdude –help” to get a description of these parameters… ;)
Don’t forget to add an external power supply to the header board since the AVRISP not seems to provide enough power. I got strange errors in the output of avrdude. After adding more power everything worked as expected.
The result: A blinking LED. Yeah! :)
Posted in: avr, board, circuit, device, diy, electronics, embedded, fun, header, news, opensource, programming
Arduino & Netduino synced communication and LCD animation
Saturday, March 12th, 2011The Arduino and the Netduino are communicating over two digital IO lines. The animation is being synced over these lines. Rafel an I wanted to make the displays run. With success… but what next? Syncing both devices!
Since Rafael is developing on the Netduino platform and I am using the Arduino as platform, we had much fun putting these two devices together and let them talk to each other. This communication is used to keep the animation on both LCD displays in sync. There is a video below but it has a really bad quality. Focus your eyes on the LCD devices when watching it.
More information will follow in the next hours… ;)
Posted in: arduino, arm, device, dotnet, embedded, fun, hacking, lcd, netduino, opensource, programming
Pages
Categories
account acta android app arduino arm attiny automation avr board book circuit code community cross cyanogen denmark desaster deutsch device diy dotnet electronics embedded extension firefox foo fosdem freedom freifunk fun games gcc gentoo german gnoduino hacking hamburg header holiday host howto httpd internet irc kernel language lcd led lego leo leo-search life linux matrix mindstorms minimal mobile monitoring nagios netduino network news nxt ooc opensource openwrt pcsc photos php politics programming question recovery robotics rsync scm sensor server service shell simulation smartcard snow soap sweden sylt telemichel toolchain translation vpn website wine wiring wsdl zsh zynk
$Date: 2011-03-12 05:24:41 +0100 (Sat, 12 Mar 2011) $

