I have a very small test project running on an Attiny85 (set to internal 8MHz).
Everything works when powering the circuit from an Arduino (3.3 or 5.0 volt). But when changing the power to a 18650 battery with a voltage of around 4.0v the Attiny85 still works, because the LED blinks, but nothing is coming through via the UART. What could be the reason for this?
#include <SendOnlySoftwareSerial.h>
#define PHOTO_RESISTOR_PIN A1
#define UART_TX_PIN 0
#define LED_PIN 1
SendOnlySoftwareSerial esp(UART_TX_PIN);
void setup() {
esp.begin(9600);
pinMode(PHOTO_RESISTOR_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
pinMode(UART_TX_PIN, OUTPUT);
}
void loop() {
digitalWrite(LED_PIN, HIGH);
int light = analogRead(PHOTO_RESISTOR_PIN);
esp.println(light);
delay(1000);
digitalWrite(LED_PIN, LOW);
delay(1000);
}