Hey guys,
Simple question and im pretty sure im good, but i want to verify:
I have an ATtiny that has a button which gets pulled down to ground when pressed. I want to control this button with a esp8266 so i can use Alexa voice controls.
I plan to connect a wire from the esp8266 to the button pin on the ATtiny85, as well as connect the grounds. The ATtiny circuit board already has a pull up on board......... however, the ATtiny is working at 5v and the esp8266 is 3v... should I just connect a pull up resistor to the 3.3v on the esp8266?
Also, on the programming side it is necessary to instruct the program to write the control pin high after i simulate the button press.
I'd leave the pin in Hi-Z (input mode) while not simulating a button press, and just make it a low output to "press" the button. If you leave the switch in and switch to a 3.3V output mode, you short out the ESP's output when pressing the physical button.
The 5V pull-up shouldn't be a problem.
A previous version of the datasheet says:
ESP8266EX Datasheet Version 4.3, ยง3.1.1, pp.17-18:
All digital IO pins are protected from over-voltage with a snap-back circuit connected between the pad and ground. The snap back voltage is typically about 6V, and the holding voltage is 5.8V. This provides protection from over-voltages and ESD. The output devices are also protected from reversed voltages with diodes.
That would indicate that a voltage of 5V on an input shouldn't damage it.
Strange thing is that newer versions of the datasheet don't mention these snap-back circuits.
Anyway, even if the ESP's pins wouldn't be 5V-tolerant, the small currents through the ATtiny's pull-up would just flow through the ESD diodes to Vcc, thus lowering the voltage on the input, without doing any harm.
If you want to be absolutely safe, just use a transistor buffer. Emitter to ground, collector to the ATtiny's input, base to the ESP's output with some high-value base resistor.
Pieter
Thanks, I will put the esppin on input mode while I'm not using it..