DIY Fraction Finder on a budget

I don’t know if it would be useful or not. I’m just guessing at this point.

But it seems like the pesky products one will require some amount of soldering. To make permanent connections, or header pins.

I should be able to help with soldering if needed.

But soldering the LEDs will be harder as those are surface mount. My eyes are going shit, and I refuse to get glasses.

2 Likes

If you don’t solder the sparkfun one is the better choice because you have the qwiic connectors and such plus the ir and uv leds are on board already like @blackie said.

1 Like

F-ME, see @CBNight, told you i always f ish up. I gotta buy one of those sparkfun boards. damnit. I have two of these pesky boards if any one finds themselves needing them…

2 Likes

I was gonna order parts for this pretty soon and happen to solder shoot me a dm

1 Like

**People who say “it cannot be done” should not interrupt those who are doing it

9 Likes

Can this be used to check relative potency of a cartridge?

2 Likes

Probably not. I wouldn’t get my hopes up, but it would be interesting to see what happens when you test different potency stuff.

The accuracy on some of the channels are +/-12%.

I was monitoring the sensor temperature in real time, and noticed it bouncing around. Turns out it is only accurate +/-8.5 C. And the sensor is using that reading for temperature compensation calculations.

I am wondering about LED light source selection, and where those LEDs should be placed if they aren’t on the sensor board.

This is from the design considerations doc:

Each as7265x chip has two LED drivers. The pesky products board only makes use of one on each chip. The spark fun board has a place to connect 3 additional LEDs for an off board light source, in addition to the three already on the board.

4 Likes

Has anyone wired up this with the raspberry

2 Likes

I think @CBNight has. @blackie, and I were discussing exploring that today actually. I ordered one. Should be here this week…

1 Like

I have everything just curious if code is the same, and wiring schematic. @CBNight

2 Likes

awesome @mwhfarms ! Good luck working it out. Remember to post your progress and results please!?

1 Like

I will for sure

2 Likes

You can pull 3.3v from pin 1 on the raspi, ground from pin 6.

I2C data(SDA) on pin 2, I2C clock (SCL) on pin 3

2 Likes

This isn’t right. The python scripts use serial, not i2c. It is expecting the raspi to be connected to the arduino that is connected to the sensor.

You make edits in the python script to the specific serial port.

spectreData = serial.Serial(“COM3”, 115200) # replace by your real comport, on Linux it is something like “/dev/ttyACMx”

3 Likes

Got it working with the raspi. Arduino plugged into the USB port of the the raspi.

In my case the python script needed to be edited in order to point the serial port at “/dev/ttyUSB0”

also needed to lower the resolution from 10000 down to 1000 to make updates happen faster.

I am using python 3, and got an error about byte needing to be an str, or something. I had to change pySpectralTriadColoredScatterLog.py line 99 from

spectreList = spectreString.split(“,”)

to

spectreList = spectreString.decode().split(“,”)

there were a bunch of python dependencies. I just ran the python script till it gave me an error, then installed what it said was missing until everything was installed.

import serial
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors
from drawnow import *
from serial import Serial
from scipy.interpolate import interp1d, InterpolatedUnivariateSpline
from math import log10

6 Likes

Nice @blackie! Good work!

1 Like

Ran into an issue where the graph doesn’t seem to be updating in real time.

It looks like the issue is caused by the Arduino constantly sending data over the serial connection. The raspi grabs some data from the serial buffer and graphs it, but the Arduino sends data faster than the raspi can graph it. The serial buffer gets fuller and fuller, and the graph doesn’t appear to update in real time.

If I kill the python script and restart, I get a good graph at first.

2 Likes

I fixed the issue by inserting a delay on the Arduino side so it only sends data every 10 seconds. Could probably do 5 or 6 seconds with my set up, but I am staying safe with 10.

I also bumped resolution back up to 10000.

6 Likes

I decided to order a raspi 4. I think I am currently using a raspi 2 for this project and it could use more horsepower. Shipping is $5 from this place, $40 total shipped

1 Like

Got it working on the raspi so no arduino is needed, the sensor can be directly connected to the raspi i2c lines.

I modified as7265x_reading from this C library so it gives the same data from the command line that the Arduino did over the serial line.

The python script can use this to get the sensor data:

import os
# spectreString = spectreData.readline()
spectreString = os.popen(‘./as7265x_reading’).read()

9 Likes