Close

ATtiny85 Testing

A project log for Uvee Py

An non-straightforward journey to build a wearable UVI indicator.

paulius-jPaulius J. 10/29/2022 at 10:390 Comments

I finally managed to program an ATtiny85 using the SparkFun Tiny AVR Programmer which I recently received. I initially attempted this with a cheaper programmer and in hindsight, I probably could get it working, I was just not used to the... lack of feedback you get with standard ATmega or the SAMD21 boards. I also tried using an Arduino Uno but I managed to mess up its bootloader in the process, so that'll be a fun project trying to get it back to a normal state.

As mentioned in the previous log - the ATtiny85 is not the only hardware change, with a switch to a smaller OLED screen, GUVA-S12SD sensor, and switching to a button battery rather than a rechargeable LiPo battery. All with the goal of making the final device as small as possible. With that in mind, I've tagged the current codebase at v0.0.1 with (mostly) functioning code for the previous hardware setup, although I'm still not confident about the battery indicator.

I've also saved the test code I used for the smaller display on a separate branch to keep track of the various experiments. It is worth noting that I've also switched to a different breakout of the GUVA-S12SD sensor that aligns with that sold by Adafruit, whereas the one you see in previous logs had a two-stage LM358 op-amp requiring additional calculations, so if you're copying my test code you can comment out the 2nd stage adjustment.


So, with the new hardware I ran a few piece of test code - seeing if I can set up the display (picture above, code here), then I ran some checks to see if I can fit the text on the screen and finally I've managed to hook up the whole circuit, as you can see below.

I'm still figuring out the exact calibration and calculations and right now it's not producing a sensible UV index value, at least not comparing to the previous iterations, so while I'm still experimenting, the code is currently on a separate branch.

The next obvious step is fixing the calculations, and assuming all that works out I'll be investigating putting the ATtiny to sleep and waking it up on demand. Considering there's no built-in capacitive touch like with the Qt Py, this should fun to experiment with.

On a final note, I'm still not 100% sure on the hardware, especially when considering moving this project onto a single, bespoke PCB. The ATtiny85 is still relatively bulky and there is a chance I might go for something close to the Qt Py, e.g. ATSAMD21G18. The GUVA-S12SD  sensor also seems to be problematic, in terms of sourcing just the sensor without the breakout board, although desoldering it from the breakout board is also an option. In the end, the main goal is to get from prototyping/breadboard stage to an all-in-one PCB and while it's quite a simple project, it's definitely an interesting journey going through this for the first time.

Discussions