This Lego autonomous rover just drives around uselessly until the battery drops under a certain level. At that point it wil go look for the charging station. It does this by driving in one direction, using a digital compass. When it hits a wall, it'll turn 90 degrees right until it hits another wall. Then it tries to turn to the first direction again and eventually the rover will pass the charging station (as it is in the back of the room). When it does, it will receive an RC5 IR signal from the charging station and it it knows it is at the charging station. It stops and parks into the charging station.
The charging station (driven by an Arduino Duemilanove) notices the presence of the rover by an distance measurement. When the rover drives into the charging station, the charging station will start a pump that drives a few pneumatic cilinders that make contact with the contact points on the rover. The power of the charger is enabled and the clock will count down for 10 hours.
When 10 hours are passed, the charging station will disconnect the charger by retracting the pneumatic cilinders. At that point the rover notices the voltage drop and comes out of hibernation and starts the autonomous program and the cycle starts over again :)
The rover can also be controlled by an old TV philips remote...
Drive around until battery runs low, then it will look for the charging station to get some juice
A distance sensor is connected to the Arduino of the charging station. This sensor polls if the rover is present or not. If not, it does nothing but sending an IR signal in RC5 codation. Once the rover drives into the station, the distance sensor gives a high value and the charging station knows that it can start the charging procedure.
The pneumatic cilinders are driven by a certain amount of time and after that the charger is activated by a 12V relay that switches the 230V of the charger on. I just a standard charger for lead acid batteries.The average time that my battery of the rover needs to be fully charged is around 10 hours so after 10 hours the Arduino just simply switches the relay again, switching off the charger. So there’s not really a “communication” between the arduino and the charger. I’ve solved it like this since it’s the most easy way. If I wanted it to do more perfectly, I’d screw open the charger and use the signal of the charge LED to tell the Arduino that the battery is charged. But it’s not necassary since the charger switches itself off once the battery is fully loaded.
Are you going to build your own charger or are you going to use a third party charger? Charging LiPo’s is much more complicated than lead acid batteries…
The charging station is positioned in a smart place in my living room: the transistion from the living room into the kitchen which is just 1 meter wide. The rover has two modes: drive around avoiding obstacles and looking for the charging station. If the rover passes the charging station while driving around, it picks up the 38kHz signal which generates an interrupt. The rover cannot pass this point to make sure that the rover remains always on one side of the charging station. It will always pick up the signal, since the “corridor” is just 1 meter wide.
When the battery runs low, the rover will go and look for the charging station. It’ll do that by turning into a certain direction using a digital compass. After turning it’ll drive until it hits the wall. If it hits the wall, it knows that it has to go right where the charging station is. In the meantime it keeps looking to the left, making it a wall follower. It could be that the rover has encountered furniture and hasn’t reached the wall yet. So when it detects it can go to the left some more, it will do that and it will turn to the right again to follow it’s path. Soon or later it will pass the small “corridor” between the living room and kitchen and thus the charging station.
It then picks up the 38kHz signal, it turns to a certain direction using the compass and then drives back until it is in the charging station.
hello there! i’m just asking because we are doing the same project. We have alrd done the sketch but it is not working properly. Could you help us with the coding? We are using the Arduino Leonardo please, we do appreciate it!