Arduino KY-035 Hall magnetic sensor module - Error

Hello. I have sim racing handbrake for PC: Link

First time it works but then it stop working. I find out that handbrake use Arduino Pro Micro and KY-035 Hall magnetic sensor module. I buy new KY-003 module and new Arduino Pro Micro. How i can code it ? I mean there is any way to find out how someone code this KY-035 Hall magnetic sensor module for handbrake ? I want to replace old one.

First – if You can't figure out why your toy broke in a first place I don't think You are able to fix it :slight_smile: But I'll try to help – check wires first, check if internal electronics gets 5v power from USB, it might be simple connection fix. If it gets 5V that means that it's sensor or wire to sensor issue or USB data wire is broken. I recommend You to replace USB cable first, it's a big chance that it will work again.

If you can't fix it and want to replace electronics – it's easy.
Coding Arduino Pro Micro is not:
1st You need to hook Your sensor correctly and get data from it to Arduino.
2nd You have to make Your Arduino Pro Micro as a HID device.

To make it work with default drivers will not be easy or even impossible due to proprietary code manufacturer used. As a last measure You can desolder chip from original board and put it on Your new Arduino Pro Micro – it should work if You make all the connections right and will not fry the chip in the process.

Tho I recommend checking all wiring and contacts first of Your original electronics – Arduino Pro Micro do not dye for no reason, it's very likely a failed USB cable.

For more help please post high resolution pictures of internal electronics.

Good luck.

First of all thanks for replay :slight_smile: I really don't know what's wrong with it but my PC can't detect it anymore. I check USB cable, also check jumper wires connection but can't find nothing strange.

So for this reason i bought new Arduino and KY-003 module. Now i search a way how i can find the program code this broken Arduino use... Here is some pictures how original one connected.

Original KY-035 vs my KY-003. I find good video explain what difference between this two: Arduino Hall sensor KY-003 or KY-024 or KY-035

Here is how KY-035 connect to arduino.

  • Green Wire to GND which connects to the - sign on the Hall sensor (- or GRN or R1 side)
  • Yellow wire To VCC which connects to the middle of the hall sensor (+5V)
  • Orange wire to A2 which connects to the S on the hall sensor (Signal)

My attempt to do the same connection...

Now i need to find code/script to program it for work like a handbrake. That's the hard part for me because i have no idea what code they use when programming it. I'm interested if there is any way to find out how someone program it or which code they use for it ?

Maybe try using the same sensor with Arduino UNO/mega (if you have one)...I suggest you to try multiple codes first and then modify it, you dont need to start from scratch since most of the things are already done

maybe try resoldering the arduino pins


check this out

You did not post picture of original Arduino – remove it entirely, plug it to computer, take a picture of it while it's plugged and upload here.

To make that sensor work is very easy – in Arduino IDE go to file>Examples>01 Basics>AnalogReadSerial.
In the code, in line "int sensorValue = analogRead(A0);" change "A0" to "A2" and upload to Arduino, open serial window (magnify glass icon on top right) and You will see sensor value. You can plug old sensor to new Adruino and check if it work, if so – most likely Arduino is faulty.

Your original sensor is bent, it should be like that?

Again, my suggestion is to troubleshoot Your old electronic – it will be way easier. Get/borrow/steal a simple multimeter and I will help You to troubleshoot it. Move out of that case original electronics so testing will be easy.

BTW, if you don't have one already – get a simple magnet, any will do – this is a hall sensor – it measures magnetic field and according to it strength sensor sends voltage from 0v to 5V back to Arduino. It's simple like that.

Well. I search some scrips and find this topic: Making a e handbrake for PC

Can i use this code for hall sensor ? Also can someone explain what this mean ? What's the difference between 12 bit and 14 bit handbrake ?


I’ve ran into a similar issue with my handbrake that I bought off Amazon. Last week I started getting the “USB Not Recognized” prompts. I found out quick that my handbrake in Assetto stopped working. In Device Manager, the device use to show up as a failed USB device… Now it stopped showing up completely!

I would like to fix my handbrake, but ran into the issue where I needed to figure out what PCB is being used, how the hall sensor is setup, and what to do regarding the code…

I e-mailed the seller of the handbrake in hopes they could send me a new board. I would be willing to pay for it! :frowning:

I found this thread, just a late night Google sesh looking for answers. I hope we can figure out a way to fix this.


I had the same problem… I’ve just resolved it so if either of you are still hanging onto those broken handbrakes, this should help.
If not then hopefully this will help someone else.

My PCB is a bit different but it still uses the Atmega32u4 and registered as having an Arduino Micro Bootloader in the control panel.

It also used a 49E hall effect sensor but that shouldn’t matter as we’re just declaring an analogue input

I literally uploaded the sketch from this tutorial you were looking at HOW TO MAKE A USB ANALOG HANDBRAKE | SIM RACING DIY EBRAKE - YouTube

// Analog eBrake-Handbrake
// PIN A0 to 10k pot output - Throttle Axis
// Use with Arduino ProMicro.
// Tested and working in DiRT RALLY + ASSETTO CORSA
// 20.1.2017

#include <Joystick.h>

void setup()

{pinMode(A0, INPUT); 

const int pinToButtonMap = A0;

void loop()

{int pot = analogRead(A0);
int mapped = map(pot,0,1023,0,255);

I could see the pcb traces to the Atmega32u4 myself and I used this image to find out what pin the Hall Effect sensor was connected to, in my case (A2)

If you can’t see the pcb in your case then I’d go with trial and error.

When the code is uploaded and hopefully when the handbrake shows up in the Control Panel as a game controller, you just need to calibrate the throttle axis and then it should work.

Hope this helps, I’ve literally made this account to post a reply here to say this can be fixed. No idea why it stopped working in the first place but it must be common with the cheap handbrakes.