use arduino to find lost pin

Hallo,
I found the below sketch here that start counting from 0000 till 9999 but how can i modify this sketch so i can use it to find a 4 digit pin from a pcb, i would like to use the arduino so i do not have to do it manually.
I would like to connect 10 outputs to a keyboard (buttons) 0-9 and “enter” and 1 input to see when the code is right
But don’t know exactly where to start?

Thanks,
Günther

const int DELAY_BETWEEN_DIGITS = 500;
const int DELAY_BETWEEN_ATTEMPTS = 1000;
const int FIRST_PIN = 2;

// try one PIN number
void enterPin (const int i)
{

char buf [5];

// print left-justified with zeroes
sprintf (buf, “%04i”, i);

Serial.print ("Doing code: ");
Serial.println (buf);

// push all 4 digits
for (byte digit = 0; digit < 4; digit++)
{
Serial.print (buf [digit]);

digitalWrite (buf [digit] - ‘0’ + FIRST_PIN, HIGH);
delay (DELAY_BETWEEN_DIGITS);
digitalWrite (buf [digit] - ‘0’ + FIRST_PIN, LOW);
delay (DELAY_BETWEEN_DIGITS);
}

Serial.println ();

// wait a bit
delay (DELAY_BETWEEN_ATTEMPTS);

} // end of enterPin

void setup ()
{
Serial.begin (115200);

// configure pins
for (byte i = FIRST_PIN; i < FIRST_PIN + 10; i++)
pinMode (i, OUTPUT);

// try all 1000 numbers
for (int num = 0; num <= 9999; num++)
enterPin (num);
}

void loop () { }

How do we know that this won't be used for illegal purposes?

...R

Does sound a bit odd, a needle in haystack type program.

There is obviously more to this than you are revealing, so why are you trying to gain access to something by trying pin numbers on some device or keyboard manually in the first place ?

Hi Robin,

How can i prove it, i bought a second hand broken robot (old one) but the seller could not give me the pin code of this so would like to use arduino to find it? I have no idea how to do this otherwise, i can rebuild the keyboard and use the arduino to "close" the buttons.

gunbiturbo:
i bought a second hand broken robot (old one) but the seller could not give me the pin code

Please provide more details of the robot.

It seems to me very strange that a robot should need a PIN code.

...R

Hello, the robot is a husqvarna automower 210 the robot was in the garage of the house that he bought but did not work so he sold it , i can take a picture of my test bench so you will see that i am not someone that stole the robot but really someone that loves electronics, i only have limited knowledge with arduino (made a battery welder a few years ago and programmed attiny 85 to make a running light) for the rest i repairs all kind of stuff just as hobby.

I still don’t understand what is the purpose of the PIN code on the mower - what does it prevent you from doing?

What sort of electronics are on the mower?

A photo of the mower may help. See this Simple Image Posting Guide

…R

Have you tried the common defaults like “0000”, “1111”,… The last digits of the serial number? Have you downloaded an owner’s manual to see if they provide a way to reset the PIN?

https://shop.husqvarna.com/us/gloves/EPCProductView?epcBrandName=Husqvarna&catalogId=13051&epcCategory=Robotic+Lawn+Mowers&langId=-1&epcOverrideCategory=&storeId=11251&epcProduct=AUTOMOWER+210C

The local Husqvarna dealer could probably do it, otherwise its likely intended to deter theft and would not be easy to reset. Pin code entry rarely allows brute-force attacks, usually by extending the time between successive entries to make it impractical, or by locking up after a number of unsuccessful attempts.

Incidentally, a little over 10% of all four-digit pin codes are 1234.

Hi all, i already tried some common pin codes but no luck, i can get the pincode from the dealer but he is asking 65 euro for it and because i have time i would like to find it without pay 65 euro for this, also because i have no idea what the problem is with the robot it is still possible that it cannot be repaired.

gunbiturbo:
I would like to connect 10 outputs to a keyboard (buttons) 0-9 and "enter" and 1 input to see when the code is right
But don't know exactly where to start?

I'd start with working out how to generate a keypress on the mower. Until the Arduino can operate the keys it's pointless. How will the Arduino know when a correct password has been entered?

gunbiturbo:
Hi all, i already tried some common pin codes but no luck, i can get the pincode from the dealer but he is asking 65 euro for it and because i have time i would like to find it without pay 65 euro for this, also because i have no idea what the problem is with the robot it is still possible that it cannot be repaired.

So you prefer to get us to give you 130 Euro of our free time so you can save 65 Euro.

Just pay the money.

...R

Are you asking how to connect the pins to pushbutton switches?

david_2018:
The local Husqvarna dealer could probably do it, otherwise its likely intended to deter theft and would not be easy to reset. Pin code entry rarely allows brute-force attacks, usually by extending the time between successive entries to make it impractical, or by locking up after a number of unsuccessful attempts.

I think it's more to prevent kids from starting it.

Have you tried Google? https://www.lawnmowerforum.com/forums/husqvarna/

As I said above, I suspect that the pin code is to keep kids from playing with it. Can you find a schematic of the mower, possibly a service manual? It may be somewhat trivial to bypass the pin code.

SteveMann:
I think it's more to prevent kids from starting it.

May also be to discourage people from stealing this expensive piece of equipment that sits outside all day and night. :slight_smile:

dougp:
I'd start with working out how to generate a keypress on the mower. Until the Arduino can operate the keys it's pointless. How will the Arduino know when a correct password has been entered?

Hi dougp, to do this that is no problem, just connect the contact of the relais in parallel on the push buttons (keys).
The arduino will not know it but i would start it when i am nearby and can hear if the pin is correct it will take a wile but this is no problem.

Robin2:
So you prefer to get us to give you 130 Euro of our free time so you can save 65 Euro.

Just pay the money.

...R

Hi Robin2, of course i can pay the money but where is the fun than, you can by everything ? I like to repair and learn new things this is a hobby.

SteveMann:
Have you tried Google? https://www.lawnmowerforum.com/forums/husqvarna/

As I said above, I suspect that the pin code is to keep kids from playing with it. Can you find a schematic of the mower, possibly a service manual? It may be somewhat trivial to bypass the pin code.

Hi SteveMann, i could not find a schematic of the pcb, i do have the service manual but it is very limited, no schematics or so just replacements on broken parts, i know there is a problem with the pcb (or other parts of the robot) but cannot test them before i can startup the pcb witht the pin.

Make or take a list of all possible combinations.. and run through them? (ZzZzZZzz)

https://www.extendoffice.com/documents/excel/3101-list-of-all-possible-4-digits-combinations.html

That being said...

I'm still not clear how you plan on pressing the keypad/buttons automatically?

*your going to connect each of the buttons in the lawnmowers/keypad to I/O pins on the Arduino? (using relays?) Did I read that correctly from your comment above?

How about you post some pics.

  • The mower itself
  • The keypad
  • The 'internals' that you will be connecting to?