Apologies as this question is not purely Blynk related, however perhaps someone has a workaround that I’ve missed.
The task is to control a digital servo which, after it’s job is completed, needs to de-power (in order to be moved manually). Since the project space is limited, I’ve decided to use a TIP120 transistor to interrupt the ground as I did with higher voltage applications.
BLYNK_WRITE(V4) button = param.asInt(); if ( button == 1 ) digitalWrite(breakPin, HIGH); timer.setTimeout(1000L, servoMove); timer.setTimeout(5000L, servoDis); } else digitalWrite(breakPin, HIGH); timer.setTimeout(1000L, servoMove1); timer.setTimeout(2000L, servoDis); }
Code is messy but kind of works.
The problem is, nodemcu will not boot unless I physically remove power from the servo before it starts.
If I fire up the nodemcu first, then connect power to the servo, it works great.
And it doesn’t matter if the power sources for the nodemcu and servo are the same or different (ground is always common). Also power supplies were checked and provide more than enough juice to run both the board and the servo.
I’m out of ideas and it’s probably something really simple and/or stupid. Anything that leads to achieving the goal without a relay is highly appreciated.
Simple diagram (not mine) explaining how tip120 works in this application.
In my case D8 is controlling the servo, D6 is controlling the transistor.