Sunday, June 21, 2015

What kept me busy the last few months

It's been a while since the last post on this blog. This hat many reasons but here are the most interresting ones:

1st of all i have replaced a thermostat in my livingroom with a tempereature monitoring and internet enabled one built by myself in my livingroom:

Until now i had a thermostat in my livingroom which was a bimetal with a turning knob scaled from 1 to 5 which ment cold or hot. Just the inside part of this thermostat costs at the hardwaresore somewhere around 50 €. To adapt that to the design of the lightswitches and poweroutlets you have to pay another 10-20 € depending on the design. So i decided to go for a replacement.

First i thought about a arduino pro mini with a 0.96 inch spi Oled display, a rotary switch and a ESP8266 Wifi-adapter. That all together costs less than a thermostat from the hardwarestore. Problem was that all that is, although the parts are very small, to large to fit in the hole of the existing thermostat. I also did not find a proper switching power supply. And the most difficult thing of the whole project was that i had to design all the Programming. Sure there is the incredible huge and mighty u8glib, and there are many libraries for the rotary encoder, but i decided to take the thing to another level and came to another solution which fits quite well.

This  is my partslist:

  1. Raspberry Pi Model A+ (24€ because it is small and has less power consumption)
  2. Pi-TFT form Adafruit. 2.8 inch resistive touch (35 € affordable and in stock)
  3. edimax nano-Wifi dongle (12 €)
  4.  USB Powersupply (had one laying around but costs 7 €)
  5. housing (6 €)
  6. micro SD Card (6€ )
  7. DS18S20 temperaturesensor (3€)
  8. Sharp solid state relay (had it laying around.price ? because it is very old and not sold any more)
all together 93 €. That is not bad for a internet-enabled thermostat that is logging the temperature to thingspeak and can be pimped to alarm-system

Here are some pictures:
old thermostat

new thermostat (sorry german)
The display did cost me some nerves, because although all 26 pins are routed through something happens with the voltage on the way and therefore the 1-wire protocol on GPIO-Pin 4 is not working. After fiddling around 2-3 days i found a thread on the mircrocontroller-forum and that led me to use GPIO5 (accessable because the Pi was a Model A+). The next Problem was that i had to use a special bootloader from Adafruit to run the Pi-TFT. Not nice.  Although it is a nifty little display and the app runing is a wxpython script. That comes handy because there is plenty of code to read out the 1-Wire temperature-Sensor.

One little thing to mention is that if you want to build the same thing: Do not try to put the RRD-Database on the sd-card. That will destroy the card by time. I am writing the temperature every 5 minutes and therefore i have placed the rrd-database in a ramdisk. To save that i have a cronjob running, that is saving this file every hour to my nfs-server. On boot i copy that file again in the ramdisk by a rc-script. The same procedure comes handy with the prefered temperature, which is written to a file (by the webserver and the wxpythonscript)

So that was the main project i was working on. Right now i am in a project to pimp my hacked IKEA Lamp that i mentioned earlier. Now i try to make a spherical light source that i can project coloured clouds on the Lamp. This could be used to build an palantir. Right now i have 20 WS2812B and a arduino pro mini in mind.

Ok. Thats all for now. If you like i would appreciate if you post comments or like/share. I try to keep this blog alive.

Sunday, October 19, 2014

Next intermediate Project:

Programmable Samsung NX300M remote.

After i testet a EOS M and sent it back because it wasn't very ergonomic i bought a Samsung NX300M. Not only has this camera a Wifi Viewfinder, but it also has a USB Remoteshutter, which is only 2 shorts between ground and Data+ and Data- and a 68K resistor. Here is whar i came up with in Fritzing (cool program to document breadboard-ciruits)

Here is the shoppinc-chart for the circuit:
  • Arduino Pro Mini
  • 2 tactile switches
  • 5 LEDs (i had some orange ones)
  • 2 Optocoupplers (i had some SFH611-2 lying around)
  • some resistors
  • 2 coincells and mounts
  • 1 mini-switch
  • 1 housing fitting in my hand
  • 1 micro-USB plug
This is the source code i hacked together. Some parts are from the arduino examples.


 /* LEDs are on Pins 12,11,10,9,8
Optos on pin 4 (shuter) and 5 (Fokus)

tactile switches on 2 (mode-switch) and 3 (shutter)
Mode 0 = only shutter
Mode 1 = endless with 0.5 sec delay
Mode 2 = same but 1 sec delay
Mode 3 = 5 sec delay
Mode 4 = 20 sec delay
*/


const int selectPin = 2;    // the number of the pushbutton pin
const int shutterPin = 3;    // the number of the pushbutton pin
int modus=0;
long lastDebounceTime = 0;  // the last time the output pin was toggled
long debounceDelay = 50;    // the debounce time; increase if the output flickers
int pinArray[] = {12, 11, 10, 9, 8,4,5};
int count = 0;
int buttonState;             // the current reading from the input pin
int lastButtonState = HIGH;   // the previous reading from the input pin
int warten=500;
//
void setup() {
// put your setup code here, to run once:
pinMode(selectPin, INPUT);
for (count=0;count<7;count++) {
pinMode(pinArray[count], OUTPUT);
}
// set initial LED state
//
for (count=0;count<5;count++) {
if ( count == modus )
{
digitalWrite(pinArray[count], HIGH);
}
else
{
digitalWrite(pinArray[count], LOW);
}
}
modus++;
//
//Shuter
digitalWrite(pinArray[5],LOW);
digitalWrite(pinArray[6],LOW);
}
//
void shoot (int shootmode) {
//shootonce
if ( shootmode ==0)
{
digitalWrite(5,HIGH);
delay (50);
digitalWrite(4,HIGH);
delay(100);
digitalWrite(4,LOW);
delay(50);
digitalWrite(5,LOW);
}
else
{
switch (shootmode) {
case 1:
warten=500;
break;
case 2:
warten=1000;
break;
case 3:
warten=5000;
break;
case 4:
warten=20000;
break;
}
while (true)
{
digitalWrite(5,HIGH);
delay (50);
digitalWrite(4,HIGH);
delay(100);
digitalWrite(4,LOW);
delay(50);
digitalWrite(5,LOW);
delay(warten);
}
}
//debounce
delay (100);
}
void loop() {
// put your main code here, to run repeatedly:
int reading = digitalRead(selectPin);
int shutter = digitalRead(shutterPin);
if (reading != lastButtonState) {
// reset the debouncing timer
lastDebounceTime = millis();
}
//
if ((millis() - lastDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
// if the button state has changed:
if (reading != buttonState) {
buttonState = reading;
// only toggle the LED if the new button state is HIGH
if (buttonState == LOW) {
for (count=0;count<5;count++) {
if ( count == modus )
{
digitalWrite(pinArray[count], HIGH);
}
else
{
digitalWrite(pinArray[count], LOW);
}
}
modus++;
if (modus >4 ) {
modus =0;
}
}
}
}
lastButtonState = reading;
if (shutter = LOW)
{
shoot (modus);
}


Some things i have figured out while writing the code. This is stil a prototype, but i think i have to put the LED off when entering the endless loop. This will 1st save battery and 2nd the light will influence a long exposure. 

Sunday, June 29, 2014

Updates

Well it has been a while since the last update on this blog but i was not lazy. I did have some projects i like to share with you.

Project #1: LED-Stripes

Some weeks ago we built a glass-wall in the garden seperating the terrace form the driveway. I bought some 8 m LED-Stripes to lighten the satinated glass. It looks very nice. Unfortunately the first LED-Stripes i had were not that quality i needet. The soldering-pads did brake lose after bending the leeds to often. The second purchase was better quality and i ordered them pre soldered. So i ended up having 8 m LED-Stripes left over. These Stripes i glued to an 40x30cm plywood and soldered them together. This ended up in a 40x30 LED-Video.light with 384 LEDs. The Light is powered by a 10xAA battery pack and is pretty bright.

Project #2: Shapeoko 2

My plan building a CNC-Machine myself did not work out that good. I had all the ballbearings and rods but i found out that not having a CNC-Machine is a pretty showstopper building a CNC-Machine. So i bought a shapeoko 2 Mechanical kit. That way i was able to use my Steppers and my grbl-Arduino to a CNC-Machine with a work-area of 30x30x7cm. I am still in a learning-procedure, finding the right feedrates for my proxxon-mill combined with the materials and router bits. Unfortunately the freeware-tools like makercam are working but they do not always do what you want.


Shapeoko2 in action
Project #3: Capische

Progress is going further. I managed to improve the python-scripts for spheric panoramas and i also have added the possibility to interrupt the program. Also i have testet generating a new housing for the capishe better performance in spheric panorama-shots. Until now the bottom is very much covered by the housing. Now i moved the panning axis more to the front so the footprint is much smaller. Here is the first test for the new housing using 4mm plywood.



Sunday, February 16, 2014

New findings, new projects

Last weekend i decided to pimp my capische with some of my findings about a home built CNC Machine. As described in the BubblegumCNC i put some stepper motors to my Proxxon KT70 and after doing the hardware i fiddled around with the GRBL firmware for Arduinos with 328p Processors. As i found out, this is a perfect combination to my capische-Project because in this firmware i can tell the arduino exactly where i want to position my camera and the GRBL is doing the math of triangulating, setting the speed correct for every stepper depending on the steps it will have to move and the only connection i have to do is the serial connection and 1 pin (feed stop/continue) to stop the GRBL while taking a Photo. Here is a fritzing pic to show the wiring:

The thing i haven't found out is how to set up GRBL for the steps/mm in x and y direction because there is no mm in that direction but the GRBL will do a turn of the camera. What i know is that the Programming will be very easy. If i define the GRBL to take 3600 mm as 360 degrees to turn a timelapse-gcode will be

G01 x900 z750 f10

which will cause the capische to turn 90 degrees while moving the dolly 750 mm with 10mm per minute. The only thing i have to do is to turn the feed stop pin low every X seconds, take a photo and continue. The only investment i had to take is a Arduino Pro Mini 5V 16MHz for about 10€ and some wiring.

By the way this is the CNC conversion of the KT70 (missing Z-axis and limit switches)


If anyone knows a cheap way to build a Z-Axis you can leave me a comment. I have the NEMA17 stepper and a M8 threaded rod already lying here and i think i will use ball bearing telescope extensions from drawers.

Monday, January 20, 2014

Raspberry Pi is a sissy

Yesterday i was just done repairing my free fall experiment and moved the 3.5 inch TV screen to the inside. By that i learned that acrylic glas can melt by a jigsaw. So i took my Proxxon (aka dremel) and a KT70 xy-stage and found out a router can melt acrylic as well :-(. Solution was to take of 0.2 mm each cut that the acrylic can cool down after cutting. Sometime i will rebuilt this to a CNC-machine. This is how it looks:


I figured out another usecase for the Capische: Stop motion. Like in timelapse photography you can set up a predefined path the camera will work its way though but the cool thing is that you trigger the movement to the next frame and trigger the photo by hitting a defined key on the bluetooth keyboard.


Then i just wanted to test a new version of the slider-program when i fried my pi by just connecting the easydriver via a sub-d port you can see on the picture. Seems like the raspberry pi cannot handle voltage-peaks. Ends up with a raspberry that can be used as a heater. The only thing it does is that the CPU heats up. I now have 3 raspberries lying around here i cannot use. 2 of them are bricked and at one (Model A) the TV-Out doesnt work any more. So if you want a raspberry pi for deco-purposes, let me know. A new one is ordered and tomorrow i can test it.

Here is the script i wanted to test out (please excuse the bad python but i am just about to test if everything works). It is supposed to move make a panning move and a move on the slider in timelapse.

import RPi.GPIO as GPIO
import time
import ConfigParser

#get the electric configuration
config = ConfigParser.RawConfigParser()
config.read('/home/pi/capische.conf')
Electric={}
options=config.options('Electric')
for option in options:
  try:
    Electric[option]= config.getint('Electric',option)
  except:
    print "Error in configfile"
    quit()

moveaccel= config.getint('Dolly','moveaccel')
movesteps= config.getint('Dolly','movesteps')
movedecel= config.getint('Dolly','movedecel')

timetowait=config.getint('Camera','timetowait')
timetowaithdr=config.getint('Camera','timetowaithdr')

maxsteps=1000

#start by setting everything to 0

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
for i in Electric.values():
  GPIO.setup(i,GPIO.OUT)
  GPIO.output(i,False)

#Pano-Easydriver wake up
GPIO.output(Electric['movesleep'],True)
GPIO.output(Electric['pansleep'],True)
GPIO.output(Electric['trigger'],False)

#nach Rechts drehen
GPIO.output(Electric['pandir'],True)

#accelerate
for i in range (0,moveaccel,20):
   for j in range (i):
     GPIO.output(Electric['movestep'],True)
     time.sleep(0.001)
     GPIO.output(Electric['movestep'],False)
     time.sleep(0.001)
     if (j % 200 == 0):
       GPIO.output(Electric['panstep'],True)
       time.sleep(0.001)
       GPIO.output(Electric['panstep'],False)
       time.sleep(0.001)
   GPIO.output(Electric['trigger'],True)
   time.sleep(1)
   GPIO.output(Electric['trigger'],False)
   time.sleep(timetowait)

#konstant
for i in range (0,movesteps,595):
   for j in range(595):
     GPIO.output(Electric['movestep'],True)
     time.sleep(0.001)
     GPIO.output(Electric['movestep'],False)
     time.sleep(0.001)
   for k in range(3):
     GPIO.output(Electric['panstep'],True)
     time.sleep(0.001)
     GPIO.output(Electric['panstep'],False)
     time.sleep(0.001)

   GPIO.output(Electric['trigger'],True)
   time.sleep(1)
   GPIO.output(Electric['trigger'],False)
   time.sleep(timetowait)

#decelerate
for i in range (movedecel,0,-20):
   for j in range (i):
     GPIO.output(Electric['movestep'],True)
     time.sleep(0.001)
     GPIO.output(Electric['movestep'],False)
     time.sleep(0.001)
     if (j % 200 == 0):
       GPIO.output(Electric['panstep'],True)
       time.sleep(0.001)
       GPIO.output(Electric['panstep'],False)
       time.sleep(0.001)
   GPIO.output(Electric['trigger'],True)
   time.sleep(1)
   GPIO.output(Electric['trigger'],False)
   time.sleep(timetowait)

#send Dolly-Easydriver to sleep
GPIO.output(Electric['movesleep'],False)
#send Pano-Easydriver to sleep
GPIO.output(Electric['pansleep'],False)

The config-file looks like this:
[Electric]
pandir=4
panstep=3
pansleep=2
movestep=15
movesleep=18
movedir=14
tiltdir=27
tiltsleep=10
tiltstep=22
trigger=11

[Dolly]
moveaccel=500
movesteps=90000
movedecel=500

[Camera]
timetowait=20
timetowaithdr=12
pan.fullturn.steps=8000
tilt.fullup.steps=4000
#focal length of 28mm (equal)
pan.steps=900
tilt.steps=700
 
 
Raspberry Pi is a Trademark of Raspberry Pi Foundation

Monday, January 13, 2014

not quantity but ...

New Year, new post.

There are 2 reasons for this post:

1. i have made a timelapse again

2. i gave an interview to fotopodcast.de

But first things first: Yesterday (January 12th 2014) my wife called me that i should grab my camera and get out to take some photos because there was a beautiful fog in the river Neckar valley and our little town was above the fog. Unfortunately it took me to long to get home so the fog has risen and the visibility was very bad. So i went to another location that is higher and i positioned my Capische to make a panorama and a timelapse. The Panorama is nothing spectacular because i have forgotten to switch the resolution to 12 MPix and so i have made a panorama from many 1600x1200 pictures in HDR. Result was a crabby 9 MPix picture. As i was waiting for the Capische to finish its Timelapse i saw that the sundown was beautiful but not in that position i was standing right now. So i grabbed the 2 tripods i had with me (one for the Capische and one for a Rollei Bullet 3s HD for documenting) and went to the other spot. That spot was on a muddy hill and half way up i lost traction and my Capische hit the ground. That was the result:

The frontpanel broke off which was good because i the Monitor is fine that way. The whole thing still works and i just have to make a new frontpanel. What can we learn from that? Not quantity counts ( i had 5 cameras with me) but the preperation is essential. If i had stayed ther i would have been able to get a longer timelapse and my trousers would still be clean. Here is the Making of (with a timelapse of the wrong location)


and this is the timelapse:


O.K. and now for something completely different: end of December i gave an interview to Stefan Lietschke of fotopodcast.de. He got interrested in this blog (the German one) because i gave them a short feedback concerning flying cameras and gigapixel. The interview should be posted at the end of January. For all german speeking People: take a look at fotopodcast, they give good tips for hobbyists and pros alike. If you have any comments or questions about this blog feel free to contact me, i will answer all the questions if i can.

Thursday, November 7, 2013

56MPixel: Done - Next timelapse

This morning was again a really nice sunset. I had some issues with the fast moving clouds, but i managed to take a panorama consisting of 4 rows in 3 lines and each photo consisted of 3 bracketed photos with 3 Stops up and down. The HDRs took about 10 to 12 sec. each photo. On a DSLR that should be much faster.

I managed to set the camera to M-Mode and the focus to manual and told the CaPiSche to start the panorama. I ended up with this picture:


This pic has 8552x6672 pixel resolution and 16 bit colordepth. Not bad for a nearly broken Canon SX200. (I had a crash with the cam and my Quadrocopter. It did fall from around 3-4 meters to concrete. Now the SX200 has no lenshood  and i replaced it with some sugru).

The next thing will be timelapse. I already set up a python script to make a panning move in timelapse with ramping.