Mika Wee
Published

Automating a button push on a car console

Automatically turn on a console button when starting up my car

IntermediateFull instructions provided2 hours354
Automating a button push on a car console

Things used in this project

Hardware components

ATtiny85
Microchip ATtiny85
×1
ESP8266 ESP-01
Espressif ESP8266 ESP-01
Prototype
×1
Digispark ATTiny85 Type-C Development Board
×1
Optocoupler Isolation Module 1ch 3V-5V
×1
42x22x12mm ABS Plastic DIY Electronic Enclosure Project Box
×1
JST connectors 2.0mm pitch
×1
USB to ESP8266 Adapter Programmer Board
Prototype
×1
ESP8266 5V Relay Module
Prototype
×1
61x36x25mm ABS Plastic DIY Electronic Enclosure Project Box
Prototype
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Diagram

Code

ESP-01/ESP-01S Prototype

Arduino
Code for the ESP-01/ESP-01S Prototype, includes a 2 second startup delay to provide some tolerance
#define RELAY_PIN 0

void setup() {
	pinMode(RELAY_PIN, OUTPUT);
	delay(2000);
	digitalWrite(RELAY_PIN, HIGH); //make GPIO0 HIGH to turn ON the relay for 0.2 seconds
	delay(200);
	digitalWrite(RELAY_PIN, LOW); //make GPIO0 LOW to turn OFF the relay
}

void loop() {
  //Do nothing
}

ATTiny85 Final Product

Arduino
Code for the ATTiny85 final product, without the 2 second startup delay (ATTiny85 bootloader already has a delay during boot up)
int OPTO_PIN = 1;

void setup() {
	pinMode(OPTO_PIN, OUTPUT);
	digitalWrite(OPTO_PIN, HIGH); //make GPIO0 HIGH to turn ON the optocoupler for 0.2 seconds
	delay(200);
	digitalWrite(OPTO_PIN, LOW); //make GPIO0 LOW to turn OFF the optocoupler
}

void loop() {
  //Do nothing
}

Credits

Mika Wee
2 projects • 19 followers
http://MikaWee.info

Comments