Code Monkey home page Code Monkey logo

modern-sla-timelapse-mk1's Introduction

modern-sla-timelapse-mk1

Setup

Raspberry Pi

  • Download the latest Raspberry Pi OS and flash it to an SD card using Balena Etcher
  • Create a blank, extension-less file on that new boot drive called ssh
  • Create a new file on the boot drive called wpa_supplicant.conf with the following contents
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
  ssid="YOUR_WIFI_NETWORK"
  scan_ssid=1
  psk="YOUR_WIFI_PASSWORD"
  key_mgmt=WPA-PSK
}
  • Boot up the Pi, and SSH into it
ssh pi@<your-ip-address>
  • Configure the pi to Auto-login at boot
sudo raspi-config
  • Navigate to System Options -> Boot/ Auto Login -> CLI Autologin
  • Save and exit raspi-config
  • Clone this repository in the home/pi directory
cd 
git clone https://github.com/modern-hobbyist/modern-sla-timelapse-mk1.git
  • Configure script to run at boot by editing /etc/rc.local
sudo nano /etc/rc.local
//Add the following line prior to the 'exit 0' line
sudo python /home/pi/modern-sla-timelapse-mk1/slaTimelapse.py &
  • Wire the light sensor to the Pi
    • VCC -> RPi's 3.3v output
    • GND -> RPi's GND
    • D0 -> RPi's GPIO Pin 4
  • Plug the camera into the Pi via USB and reboot!
sudo reboot

Scripts

I will update this as the project evolves, but currently it is made up of 4 different scripts:

  • install-gphoto2.sh
  • initialize-camera-save-to-sd.sh
  • trigger-snapshot.sh
  • slaTimelapse.py

Install-gphoto2.sh

This script, once run will execute everything needed in order to install GPhoto2. I got this script from FormerLurker in his OctoLapse repository, since OctoLapse uses GPhoto2 as well. You will need to run this script first after SSHing into the Pi.

./modern-sla-timelapse-mk1/install-gphoto2.sh

Initialize-camera-save-to-sd.sh

This script does a little bit of setup for GPhoto2 to correctly set the capture target, which will cause the picture to be correctly saved onto the camera's SD card. This is executed by the slaTimelapse.py script which we will configure to run at boot.

trigger-snapshotsh

This script is the one that actually triggers the snapshot to occur, and it is also executed by slaTimelapse.py when it detects a flash of light.

slaTimelapse.py

This is the main script of this project. It is a pretty simple python script that reads the input of pin 4 on the Pi zero. If the input from pin 4 is low, then the light sensor is reporting that it sees light. Since an SLA printer only exposes the new layer of resin for a brief period of time, the script will trigger one snapshot, and it won't trigger another snapshot until the sensor has reported darkness and the next flash of light. This script executes initialize-camera-save-to-sd.sh once at the beginning of the script, and trigger-snapshot.sh each time a pulse of light is detected.

modern-sla-timelapse-mk1's People

Contributors

csteamengine avatar

Watchers

James Cloos avatar  avatar

modern-sla-timelapse-mk1's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.