pdknsk wrote:I've got an additional question. Most of the photo transistors are rated at 5V "emitor-to-collector" voltage, but some at 7V. Is this relevant?
pdknsk wrote:PS. It's amazing that selling for 8c is profitable for Mouser, or anyone involved.
pdknsk wrote:Alright, I've built this (without LCD for now). It seems to work quite well, for a first draft.
pdknsk wrote:I couldn't make it work with a digital pin, because it didn't flip unless I put the photo transistor very close to a candle. I only had a 10k and 1k resistor, which is apparently not enough to get decent sensitivity. I've put a 100k potentiometer on the shopping list.
pdknsk wrote:To have a fixed frequency for comparison and calibration I've put another arduino and some LEDs on the shopping list. The internal PWM supposedly runs at 490Hz.
pdknsk wrote:What I've noticed though, is that the arduino can only analogRead() at a rate of about 8000 per second. Plenty for 1kHz, but still somewhat limiting. It seems that digitalRead() doesn't have this limitation.
pdknsk wrote:This does probably work, but only provides a few steps. So I had another idea, to make this seamless. What if there was sth. like a software controlled resistor. Like a regular resistor basically, but with an additional pin that connects to an arduino pin, which can be written to in order to set the resistance. It turns out such a device was already invented! They called it a digital potentiometer.
pdknsk wrote:If this doesn't work, I'll just use a normal potentiometer to manually adjust for different monitors.
pdknsk wrote:I've got the 1M potentiometer and was able to get some excellent results.
pdknsk wrote:I'm actually shocked by the accuracy. Using tone() for the LED, which is an excellent and seemingly very accurate PWM function, I measured the frequency precise to 1Hz at 10kHz! This is turning out much better than expected.
pdknsk wrote:I measured 200Hz for the backlight. I have no means to verify this is accurate, but it'd be too much of a coincidence to get such an exact value if it wasn't accurate. Using the previous setup with analogRead() and 10K resistor, I had measured ~240Hz, so not so bad a result.
email@example.com wrote:If you're measuring the signal with the same device that's generating the signal, any errors will be shared and will cancel out. Even so, the results you're seeing should be pretty close to what you'd see from a calibrated source.
Users browsing this forum: No registered users and 13 guests