GithubHelp home page GithubHelp logo

lemariva / upyfocus Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 5.0 33 KB

Add autofocus to the 16 mm Telephoto Lens mounted on the Raspberry Pi HQ Camera (Firmware for the M5Stack)

Home Page: https://lemariva.com/blog/2020/12/raspberry-pi-hq-camera-autofocus-telephoto-lens

License: Apache License 2.0

Python 100.00%
raspberry-pi-hq-camera raspberry-pi-camera m5stack autofocus-camera

upyfocus's Introduction

Autofocus for the 16mm telephoto lens mounted on a Raspberry Pi HQ Camera.

As you may have already noticed, the Raspberry Pi HQ Camera lenses don't have any autofocus functionality. This project includes the hardware design, firmware and software to add autofocus functionality to those lenses. In this case, I use the 16mm telephoto lens. The project is divided into two repositories. This repository includes the code of the M5Stack firmware whereas lemariva/rPIFocus includes the code for the Raspberry Pi, in which the Microservices application runs.

A detailed article about the application can be found on Raspberry Pi HQ Camera: Autofocus for the Telephoto Lens (JiJi).

Video

Autofocus for the Raspberry HQ Camera

Photo examples

Focus Type: Box - Background focused Focus Type: Box - Nanoblock bird focused Focus Type: Box - Nanoblock bird focused. Diff. illum & cam. aperture Focus Type: Object detector - Teddy bear focused
Focus Type: Box
Background focused (download)
Focus Type: Box
Nanoblock bird focused (download)
Focus Type: Box
Nanoblock bird focused.
Diff. illum & cam. aperture (download)
Focus Type: Object detector
Teddy bear focused (download)

Simple PCB schematic

Inside the folder pcb, you'll find the board and schematic files (Eagle), to order your PCB. I also added the Gerber files that I used by jlcpcb.

M5Stack Application

The M5Stack ATOM Matrix controls the motors and offers a RestAPI to receive the commands. The M5Stack application is programmed in MicroPython. If you haven't heard about MicroPython, you can check this tutorial: Getting Started with MicroPython on ESP32, M5Stack, and ESP8266. MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimized to run on microcontrollers and in "constrained environments". The application is located lemariva/uPyFocus.

So, follow these steps to upload the application to the M5Stack:

  1. Flash MicroPython to the M5Stack as described in this tutorial.
  2. Clone the lemariva/uPyFocus repository:
    git clone https://github.com/lemariva/uPyFocus.git
  3. Open the folder uPyFocus with VSCode and rename the config.py.sample to config.py.
  4. Open the file and add your Wi-Fi credentials in this section:
    wifi = {
        'ssid':'',
        'password':''
    }
    The M5Stack needs to connect to your Wi-Fi so that the Raspberry Pi (also connected to your Wi-Fi/LAN) can find it and sends the commands to control the steppers.
  5. Upload the application to the M5Stack.

After uploading the code, the M5Stack resets and starts with the calibration routine. Take note of the IP that the M5Stack reports while connecting to your Wi-Fi. You'll need that to configure the Microservices Application on the Raspberry Pi.

upyfocus's People

Contributors

lemariva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.