Need help with starting my car

Hello

I have ttgo t-call sim800L connected to blynk via GSM and I am using 8relay shield with MCP23017 with lastest iOS

My question is how to handle starter of car…

unsigned long startMillis = millis();
unsigned long currentMillis = millis();
while ((rpm < 650) && (currentMillis - startMillis < 2000)) {
        mcp.digitalWrite(startRelayPin, false);
        currentMillis = millis();
        Blynk.run();
}
mcp.digitalWrite(startRelayPin, true);

rpm sensor is connected via interupt pin and calculates rpm from frequency. sorry for my english and stupid question but I’m noob :slight_smile: i can publish whole code but it has over 700lines

What exactly is your question?

Pete.

my question is how to make it differently… because while starting blynk isnt responding and sometimes it starts longer than it had…

To avoid killing your starter just because the Blynk MCU locks up… perhaps separate your starter relay and RPM sensor into its own non-Blynk code on dedicated MCU that can than interface with the Blynk MCU as needed (via i2c or even serial perhaps?) EG. to start when asked, sense results, abort/retry as needed and confirm success back to Blynk MCU when finished.

what type of MCU should I use? can you recomend me something? relays are connected to MCP23017 via i2c, (sometimes not working as I expect… maybe my fault :smiley: )

You should either use a NodeMCU/Wemos D1 Mini, or an ESP32. If you went for the ESP32 then you’d have many more useable GPIOs so you probably wouldn’t need the MCP23017.

Pete.

problem of using ESP32 pins is that while boot or restart some pins have some output… and while restart or something unexpectable relays cannot change states, and I have lot of inputs like: ( RPM , lockStatus, keyIn, oilPressure, battery ) all this is connected directly to ESP32 allso i have temperature sensors, LDR sensor, and currently using 8 relay and wanted more :rofl: … maybe im not using the right HW but i am not an electrician

Yes, but if you take a look at this, you’ll see that there are many ESP32 pins that are suitable for use with relays:

But of course there’s nothing to stop you using an ESP32 and one of more MCP23017s.
I did a few experiments with MCP23017s recently and wrote-up some of my findings here:

Pete.

Also, have you thought about using CANBUS to do this?
The ESP32 has a CANBUS interface and if your car has OBDII then it ‘should’ be possible.

Pete.