Sunday, March 23, 2014

Retrofitting Roomba 530 with a Raspberry Pi. Hardware

I own Roomba 530 which had main board broken due to long period of inactivity.
Battery was dead so I had to buy a new one. Upon connecting I've got dreadful "Charging error 3" which means there is something wrong with a charging circuit. After closer look at main board I discovered that some paths got eaten by battery acid.
Fixing the board didn't look like fun and throwing away the cleaner didn't look like a good decision ether. I decided to replace the main board with a Raspberry Pi board.

Motors

Roomba 530 has 5 motors - 2 for wheels, 1 for brushes, 1 for vacuum and 1 for that funny brush you have on the side of the cleaner.
Motors responsible for cleaning can be connected straight to the power maybe with some PWM.
As far as wheel motors go we need to be able to control each motors in both directions individually. H-bridge is the perfect man for the job. I used a circuit based on widespread L298N chip. You can buy ready-to-use board with radiator, connectors and diodes.

Sensors

Roomba 530 has surprisingly big amount of sensors.

Hall sensors are used to count motor revelations. I couldn't make it work with the original ones after several tries. Luckily hall effect sensors are tiny, so I bought TLE 4905L which fits perfectly between the board above the motor and the magnetic disk - I used glue to fix it in there.

"Bump" sensors - the ones that detect when cleaner has hit something. They are pretty straight-forward - it's an optical pair - 5v power to the emitting diode and receiving diode to the digital IN.

Proximity or "wall" sensors - they are responsible for detection if Roomba is near the wall. There are 6 of them. During my experiments I fried some of them and I was also lacking specifications for them, so they were replaced with SFH409. Receiving diodes have to pick up IR light reflected from the wall or some other obstacle so SFH409 have to emit a lot of IR light. Doing so continuously will damage the diodes (I burned through at least 10 of them). You pulsate them for 20ms every 100ms with about 100mA of current. It does the trick.

Front wheel encoder. Front wheel is a black and white. Emitting and receiving diodes are placed above it. When wheel rotates it changes it's color - when it's white IR light is reflected and when it's black receiving diode closes, by counting the signals we can calculate the distance.
This encoder serves as an additional one to the wheel sensors which do the same job. It helps to determine if the cleaner is stuck - driving wheels can rotate even if the Roomba is not moving, bu the front one is passive - it only reports actual distance.

Stair sensors. These are basically the same as wall sensors but facing the floor. Help the cleaner not to fall down the stairs. As my apartment has no stairs they are not connected.

"Home base" sensor. The one on top of the Roomba 530 - locates charging station and also used for "virtual walls". Haven't found it all that useful so it's not connected either.

Dirt sensor.
This one is kinda useful but not implemented as of now. It uses piezoelectric sensor - placed above the brushes - dirt is hitting it while cleaning and if there is a lot of it - it hits harder :) The problem is that it has a small circuit connected to it which I have no documentation or communication protocol for, so for now it's just hanging in there.

Speaker

Roomba 530 has a speaker and Raspberry Pi has audio output. Although I have no use for it now seemed like a waste not to connect the two :) 
I used LM386 for amplifier.

1 comment:

  1. It comes with the first-rate capabilities to make sure your house is loose from any pet hair or even allergens. it's far friendly to pets and causes a minimal disturbance while in action. except, it's far very less costly for this reason making it one of the fine Roombas for pet hair and allergens. in case you need to check the waters with the Roomba, this is a tremendous desire! check over here

    ReplyDelete