Code Monkey home page Code Monkey logo

photon's Introduction

Action Shot

YouTube Channel Views

Instagram

Photon: an open-source incident light meter

Photon reproduces the some of the functionality of more expensive tools, using a few inexpensive/readily available parts. Currently it measures ambient light brightness, as well as the red, green and blue components of the light, which might allow White Balance readings in future iterations.

There is soldering involved, but don't let that put you off, it's easy.

COMING SOON: Flash Mode

Background

An incident light-meter can be an essential tool in photography (especially film photography with old cameras). The sophisticated computation baked-in to modern cameras devotes a lot of effort guessing 'how much light is falling on the subject?". If you have the option of getting to the subject and taking a reading, no guessing is required and everything becomes a lot easier. A more in-depth description in the video below:

IMAGE ALT TEXT HERE

Components

Assembly

Hardware

Solder the power shim to the pico, following the Pimoroni instructions. Connect the Lipo/LiIon battery to the shim.

Then connect the rest of the components to the GPIO pins as described in the tables below. (VCC and GND are also connected to the pico for all except the switch)

Action Shot

Light Sensor

Pico GPIO BH1745
4 SDA
5 SCL

OLED

Pico GPIO OLED Pin Number
19 DIN/MOSI 25
18 CLK/SCK 24
17 CS 22
20 DC 26
21 RST 27

Rotary Encoder:

Pico GPIO Rotary Encoder
6 CLK
7 DT
8 SW

The Two Switches

Connect one end of the switch to GND, and the other to:

Pico GPIO Switches
15 Measure (Keyboard Switch)
22 ISO (6x6mm switch)

Enclosure Assembly

Once you've tested that things are working, squeeze the parts into an enclosure. If you have access to a 3D printer, there are stl files in the cases directory.

Software

Download a uf2 image from the Pimoroni github repository and install it on the Pico according to the instructions. You need to use the Pimoroni image to be able to use Pimoroni drivers for the light sensor.

Clone this repository to your computer using the commands (from a terminal):

cd ~
git clone https://github.com/veebch/photon.git
cd photon

Check the port of the pico with the port listing command:

python -m serial.tools.list_ports

Now, using the port path (in our case /dev/ttyACM0) copy the contents to the repository by installing ampy and using and the commands:

ampy -p /dev/ttyACM0 put drivers/
ampy -p /dev/ttyACM0 put gui/
ampy -p /dev/ttyACM0 put color_setup.py
ampy -p /dev/ttyACM0 put main.py

(nb. make sure you are using the right port name, as shown in the port listing command above)

Done! All the required files should now be on the Pico. When you disconnect from USB and power on using the button on the power shim the script will autorun.

Using the Light Meter

A tutorial on getting the most out of your new meter is in the docs section.

Contributing to the code

If you look at this, find it interesting, and know you can make it better then please fork the repository and use a feature branch. Pull requests are welcome and encouraged... in a nutshell:

  1. Fork it
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

If that all looks a bit too programmy, and if you have some photography expertise that you think could be embedded in the code then raise an issue on GitHub or contact us.

Licence

GNU GENERAL PUBLIC LICENSE Version 3.0

Appendix

Calculation of Values

The simple calculations that lead to a reading are based on the Wikipedia entry on exposure value.

The illuminance returned by the Pimoroni BH1745 ( $L$ ) is converted to an exposure value ( $E_v$ ) for ISO 100 using

$$E_v=\log _2 {{L} \over {C}},$$

where $C$ is the light meter calibration constant.

This exposure value is then adjusted to an Exposure value for the chosen ISO ( $E_{ISO}$ ) using

$$E_{ISO}=E_v + \log_2 {{ISO}\over{100}}.$$

Then, depending on the priority on the light meter, the remaining value is calculated using

$$t = {{N^2} \over {2^{E_{ISO}}}}$$

or

$$N = \sqrt{t 2^{ E_{ISO}}}$$

where $t$ is shutter speed and $N$ is f-stop. The value is then rounded to the nearest nominal value and displayed on the screen.

photon's People

Contributors

040medien avatar debruehe avatar iamyd avatar ryan1894 avatar veebch avatar

Stargazers

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

Watchers

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

photon's Issues

Don't work with me ;(

Hello, thank you for sharing your project with the community.
I don't see a discussion forum so I'll open as an issue, sorry.

IMG_3891

So... I've followed everything... I believe.
So far, the LCD don't turn on and with the battery connected I don't have a signal in the board that is charging and don't turn on connected directily with the battery; the rest of the components I don't know how to test.

I used the pimoroni-picolipo_16mb-v1.20.4-micropython.uf2 because is the Pi that I have and uploaded the files using Thonny.

When I press the switch a light blink don't power up; if I have the Pi on and press the switch the power led only blinks once.

Help? ๐Ÿ˜…

Many thanks
๐Ÿป

im missing something

Hi, im pretty new to this sort of thing and running into an issue.
when i run de code in thonny i get an error, name 'ssd' isn't defined.
am i doing something wrong here or is there something im not seeing, being a novice at this?

i am using a pico lipo board with pimoroni-picolipo_16mb-v1.19.10-micropython.uf2

%Run -c $EDITOR_CONTENT
Traceback (most recent call last):
File "", line 195, in
File "", line 24, in splash
NameError: name 'ssd' isn't defined

Pico Lipo Battery Level Shows -185% when startup

When I am starting the Photon on the splash screen it will show -185% (Sometime -186%), however if I am reading from the Thonny it will display the correct percentage. When I am debugging from Thonny, it will shows the correct voltage on screen as well. Have you experience it before?

I am trying to googling it, but it doesn't seems to go anywhere. In the main.py, the power management code is the same as the example pimoroni provided. Everything else works perfectly, what should I try to debug next?

Rotate Display

Hi there,

I am building a custom case and pcb to house all the components in a different form factor. Unfortuantely the design requires me to rotate the display 180. I'm having trouble finding examples of how you'd rotate the display 180 with micro-python. Have you looked into this before or have a solution?

Soldering still required?

I bought the Pico Lipo which in turn doesnt need soldering of a shim.
Do I need soldering for anything else besides the aforementioned shim?

flash?

it would be awesome to have this be almost 1:1 with e.g. a sekonic l-308

Stupid noob question

Hi. I have zero Python experience and was interested in trying this as a first build. If I attempt to do this with qwiic connectors rather than soldering, will I need to make changes to the code?. Sorry, I'm sure that's a really dumb question but I've no idea how this works.

BH1750 instead of BH1745

Hi, I'm planning to build this and currently BH1745( Colour and luminance sensor) has been unavailable for a long time. Since the calculation part just shows that luminance is used. Can BH1750 which is just a luminance sensor be used instead of BH1745 ?

Doesn't seem to do anything

Hello,

Any tips on troubleshooting an issue where the Pi doesn't seem to have any activity? I've connected the hardware as shown, and loaded the software as directed, but when I power on I see no activity on the OLED or any of the associated LEDs. Where would I look to figure out what the problem is? Unfortunately, I am not familiar with Python

Resin vs PLA

Hi there, finished the build, it's awesome, thank you for making it and sharing it! One q I have is related to the lumisphere. Can you share the print settings you used for the lumisphere? I'd like to compare it to the FDM versions I printed. Thank you. (also one small note, for the back pico lipo case, I found M3 screws to be a better fit for the bigger holes - not sure if that was a typo or my printer is just crazy :) )

No display output

After assembled everything, there are no display. Then I thought it was issue with my solder, I re did all my soldering, still the same issue. I attempted to troubleshot using Thonny, the main.py ran without any error message. I decided to order a replacement screen, still nothing shows up. My multimeter shows the display is getting 3.3 volt, and the wiring connection is connect to the pico lipo. I attempted to write a hello world using the diver in the repo, still nothing shows up. Any recommendation on what to try next?

How to attach rotary encoder?

My rotary encoder came without a breakout board, and according to most pictures, the middle of the 3 pins and one of the two pins are connected to ground

but I can't get my rotary encoder to output anything when connected to arduino lab for micropython

Am I supposed to connect to middle of 3 pin to VCC?

Edit: I have it working in arduino lab, but outA.value is always equal to outB.value for both directions

theyre either both 0 or both 1

For reference I am using an EC-11 rotary encoder I pulled from a previous keyboard project. It seems that the pico is checking too slow?

installing to pico

i managed to get everything soldered and together, but i get no picture on the OLED and i also cant figure out how to install the necessary files to the pico. I have tried, Thonny, Putty, and Gitbash. Ive tried all codes provided and cant seem to figure it out. cant get the port of the pico either. what is the proper steps to install this into pico. i have no experice with code or even python.

3D-Assembly

Is there a chance that you will offer a 3D-Assembly?
At least for the printable parts? or share the parts in a neutral solid format like STEP? I would love to build the Pico Lipo version but might try to modify the case a bit.

Calibration Constant?

Hi there,

I see your calibration constant is set to 15. Why chose 15 over typical regular constants such as 12.5 and 14? Could you tell me about this value choice? (Newbie here and trying to understand this more)

required files result in error

After the update to the read me file the last step of installing the files to the pico result in an Error: Invalid value for each of the commands. Could the files be uploaded to the pico using Thonny?

Cannot get ampy to install to Windows Powershell

I am trying to get the software-side of this project to work - to no avail.
I have installed Python on my Windows Laptop.
I then need to install the python package installer (pip) and only then can I install ampy and thusly the photon software.

Am I understanding this correctly from a newbs' perspective?

Thanks for the help in advance and greetings from Cologne.

Install time

How long should it take ampy to install the files onto the pico? Mine has been flashing for about 15 minutes with no changes.

Finer Aperture values and lux values

Is it possible to get the Software to show finer aperture Values (like 1/6th or the exact decimal value)?
Also is it possible to display lux values?

I am going to build the original one but plan on modifying it for a special purpose.

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.