Keyless Ignition for Skidsteer

Place your projects here
Post Reply
Zim
Posts: 302
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 303 times
Been thanked: 134 times

Keyless Ignition for Skidsteer

Post by Zim »

I'm tired of forgetting the key in the house. This will connect in parallel to the existing key switch, allowing either to operate. It uses your 4 digit code. If the code is entered in the proper sequence, the ignition turns on. Each key entry will return a short "beep". If the wrong code is entered, a long "beep" will result. If the correct code is entered, 3 short "beeps" will result, turning the ignition on. The motor will crank while the "star" key is depressed. Once the motor is running, any button press will shut it down. The module will then go into deep sleep, which will automatically awakened with the first key press. (the module will only awaken when one of the top row buttons is pressed, so use one of these for your first choice in your code. (1,2 or 3)). If the correct code is entered, and the ignition is turned on, it will turn off, and return to sleep if the crank hasn't been attempted within several seconds. Once the module has been awakened, it will remain an AP for a short period, allowing you to communicate through WiFi.
The dual relay uses a ground to energize the relays. I recommend to modify the circuitry so a positive voltage from the module energizes it instead.
Thanks to cicciocb for the keyboard example.


This project can cause catastrophic damage and/or DEATH if not done correctly. Do this at your own risk. This is NOT recommended for the hobbyist.
keypad_2.jpg

Code: [Local Link Removed for Guests]

'skidsteer
PIN.MODE 4, INPUT     ' wakes up module
PIN.MODE 17, OUTPUT   'ignition power
PIN.MODE 16, OUTPUT   'starter crank
PIN.MODE 18, OUTPUT   'acknowledgement buzzer
PIN(16)= 0
PIN(17)= 0
PIN(18)= 0

count = 0
crank = 0
ignition = 0
timr = 0
line$ = ""
k$ = ""
kp$ = ""

dim rows(4) = 26, 25, 33, 32
dim cols(4) = 35, 34, 39, 36
dim sym$(16) = "1", "2", "3", "A", "4", "5", "6", "B", "7", "8", "9", "C", "*", "0", "#", "D"


for z = 0 to 3      ' set the pins as input and output
  pin.mode rows(z), output
  pin.mode cols(z), input, pulldown
  pin(rows(z)) = 0
next z  
k$ = ""
Kp$ = ""

timer1 60000, wifioff 'wifi off in 1 minute after start

OPTION.WDT 3000

do
  scan k$
 
  if (k$ <> kp$) and (k$ <> "") then
     line$ = line$ + k$
      count = count + 1
       gosub shortbp 'acknowledge key press
         print line$
end if

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  my code v
if line$ = "####" then reboot  'reboots processor
if line$ = "2345" then '      lock code is 2345
          ignition = 1
           PIN(17)= 1
            print "ignition on"
            gosub threebp  'ignition success
endif

if line$ = "1234" then '      lock code is 1234
          ignition = 1
           PIN(17)= 1
            print "ignition on"
            gosub threebp  'ignition success
endif

if (count > 3)and(ignition = 0) gosub longbp   'long beep for error

if count > 3 then        'limits the code attempt to 4 digits
           line$ = "" 
             count = 0
endif

if (line$ <> "")and(line$ <> "*")and(ignition = 1) then          'engine kill
              OPTION.WDT 0
              ignition = 0 
               PIN(17)= 0
                count = 0
                 line$ = ""
                 print "engine kill"
                 gosub sleeep
endif

if (ignition = 1)and(k$ = "*") then pin(16)= 1 else pin(16)=0   'cranking
pause 100
if pin(16) = 1 print "cranking"

if (ignition = 0)and(timr = 0) then
      timer0 180000, sleeep         'sleeps after 3 min of ignition off
         timr = 1
endif

if ignition = 1 then 
      timer0 0
       timr = 0
endif       


 kp$ = k$
 pause 10
option.WDTreset
 loop


sleeep:     'sleep after 1/2 hour of no ignition
print "sleeping"
pause 1000
SLEEP 31536000, 4, 2   'choose pin and state    forever,pin 4, wake when top row of keyboard pressed
Pause 100
return

shortbp:        'acknowledge
PIN(18)= 1
print "beep"
pause 50
PIN(18)= 0
return

longbp:         'error
PIN(18)= 1
print "beeeeeeep"
pause 1000
PIN(18)= 0
return

threebp:         'success
PIN(18)= 1
print "beep beep beep"
pause 50
PIN(18)= 0
pause 50
PIN(18)= 1
pause 50
PIN(18)= 0
pause 50
PIN(18)= 1
pause 50
PIN(18)= 0
pause 50
PIN(18)= 1
pause 50
PIN(18)= 0
return

wifioff:
wifi.sleep
return


'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  my code ^

sub scan(key$)
local r, c, l, code
code = -1
for r = 0 to 3
  pin(rows(r)) = 1
  for c = 0 to 3
    l = pin(cols(c))
    if (l=1) then
      code = r*4 + c
      exit for
    end if
  next c
  pin(rows(r)) = 0
  if (code <> -1) then exit for
next r
if (code <> -1) then key$ = sym$(code) else key$ = ""
end sub
You do not have the required permissions to view the files attached to this post.
Post Reply