Donnerstag, 13. Dezember 2012

Controlling a stepper with raspberrypi gpio pins

Raspberry RASPBRRY-MODB-512M Mainboard Sockel (ARM 1176JZF-S, 2x USB 2.0, 1x HDMI)





First of all, you need the wiringPi library from https://projects.drogon.net/raspberry-pi/wiringpi/download-and-install/
Once installed, there is a new command gpio which can be used as a non-root user to control the GPIO pins.

I took a schmalzhaus easydriver stepper shield, controlled with a little shell script.

circuit layout:



My stepper has 1,8° = 200 Steps for 360°
GPIO pin 23 controlls the steps, one high peak per step,
GPIO pin 24 controlls the direction

30 times clockwise and counterclockwise Rounds:

shell script:

#!/bin/sh
pause=0.001
gpio -g mode 23 out
gpio -g mode 24 out


for i in $(seq 30); do

echo round $i starts:
sleep 1

gpio -g write 24 1
for i in $(seq 200); do
  echo $i
  gpio -g write 23 1
  sleep $pause
  gpio -g write 23 0
  sleep $pause
done
sleep 1
gpio -g write 24 0
for i in $(seq 200); do
  echo $i
  gpio -g write 23 1
  sleep $pause
  gpio -g write 23 0
  sleep $pause
done
done

Dienstag, 6. März 2012

Arduino to google docs

Dienstag, 31. Januar 2012

Adafruit Waveboard Sample Rate fun

Changing the sample rate with Arduino UNO and the Adafruit Waveboardshield makes fun:


Here the things you need:



instead of the potentiometer you can use any analog value, fun fun fun

Samstag, 21. Januar 2012

Pachube - Arduino Ethernetshield with a DS18S20 Temeprature sensor

Test of a Arduino Ethernetshield with a DS18S20 Temeprature sensor:



There you can simple and free log any data, like Temperature.

Here is the code for Arduino and the new Pachube lib: