I am currently creating a project that will use an ATtiny85 to set an output after a delay (determined in the setup by a potentiometer) ONLY WHEN the lights are OFF (this part using a photo resistor)
For some reason, the chip is behaving as if the photo resistor is not even present, activating the output right after the delay. It works on the arduino, but not with the Attiny85. My code is below. Any suggestions?
alright... that problem sorted itself out. Photocell is working fine. NOW i'm having a bigger issue....
For some reason, the LEDs hooked up to pins 2 and 1 are turning "on" before the chip is even powered (I have the chip's V+ unplugged)
Here's the strange part:
this only occurs when the POT or the photocell is hooked up to its pin... changing the POT changes the brightness of them too. After this some time, they shut off and the logic will work if I hook up V+.
Power noise could cause strange analog readings. I would recommend adding a 0.1 uF ceramic decoupling capacitor between VCC and GND, if you haven't already.
Here is the schematic (sorry for the delay, I just got home).
What seems to be happening is that some internal part of the chip is storing a charge and thus carrying out the program when VCC is removed... I'm going to try reprogramming them for the heck of it... but it's definitely something with the chip.
The items that are on the battery side of the power switch are causing the problem. You will have more that enough tome for the Arduino to wake up.. If Not then rewire those inputs so that they pull down a processor pin that is powered up when the Arduino is. The bias path for the Arduino IS the stuff that isn't switched off when the Arduino is.
Docedison:
The items that are on the battery side of the power switch are causing the problem. You will have more that enough tome for the Arduino to wake up.. If Not then rewire those inputs so that they pull down a processor pin that is powered up when the Arduino is. The bias path for the Arduino IS the stuff that isn't switched off when the Arduino is.
Doc
so, if I understand you right, the arduino is discharging through my chips when disconnected?
When the processor is not correctly powered, electricity can "leak through". In addition to causing the problem you are having, there is a high probability that it will damage the processor. Move SW1.