Hello
I'm currently working on a project where I want to be able to control a fan and display the speed with help of three LEDs.
For the fan control I'm using a LM317 voltage regulator and some capacitors, and for controlling the LEDs I'm using a ATTINY85. I wrote a simple sketch to the ATTINY85 that would turn on the LEDs depending on the speed.
To check if it's working I plugged in the potentiometer to a arduino uno and observed the readings.
When I powered the circuit with 5 volts (from the arduino) the readings were fine and consistent, it worked liked i wanted to. But when I powered it with 12 volts via an AC adapter the values weren't consistent anymore.
How can I solve this?
EDIT:
Uploaded image, this is the wiring when I was testing the potentiometer.
A proper circuit diagram might help. But if you are trying to run an ATTINY85 (max. voltage 5.5V) on 12V it's not difficult to guess why it may not be working.
The ATTINY85 is not plugged in (yet), this is only to test the potentiometer. It was plugged in to the arduino uno and the 12v power source was plugged in to the powerbus (to the left). I'll draw a schematic and upload it.
You need to produce a proper schematic - it is much too easy to confuse connections in a picture like that, And the business of drawing the schematic can often bring problems to the surface.