r/Python • u/Marc_B7 • Feb 16 '19
A line follower robot my classmade and i made with python for our minor project. Turned out working great :D
11
5
Feb 16 '19
What kind of OS is running on the raspberry PI?
3
5
Feb 16 '19
Besides the raspberry pi what hardware did you need
4
u/Marc_B7 Feb 16 '19
We used a powerbank for the batteries, a rgb color sensor and the robot is a standard robot package you can buy. We also had an ultrasonic sensor but we didnt use it.
22
u/TurnTheTideTM Feb 16 '19
Very cool! If you want it to go faster, look into the PID control algorithm, it's rather easy to implement and leads to great improvement.
4
u/xCAKSx Feb 16 '19
Are you guys bachelor students?
5
Feb 16 '19
Not sure if they did this for a class or not, but my school has this as a class project for a 100 level ECE course.
2
u/TheGenocides Feb 16 '19
I had a similar assignment in 2013 in ECE 101, but I also had to stack a brick on a pillar and hit a ball into a cup that was 1 foot away. These damn millennials have everything so EASY! /s
4
4
3
u/DQQpy Feb 16 '19
What's the reason for having two ultrasonic sensors? They don't look like they are inclined.
3
u/desal Feb 16 '19
Jeez, get your shit out of the way, cant you see my little buddy is trying to get to work /s
7
2
u/Marz0008 Feb 16 '19
Why is it turning so much when the line is straight? Great job BTW
5
u/IAmDaBadMan Feb 16 '19
If I were to hazard a guess,the reflection of the light coming from the window onto the shiny tape is throwing the robot off.
2
u/hoppla1232 Feb 16 '19
Really cool to look at! Did you use a PID to drive along the border between black and white or is it a digital black/white recognition? A few years ago I and a few frieds of mine programmed a Lego Mindstorms EV3 robot with Python using an SD card to liveboot a Linux System on it and it was so much more convenient to program using Python instead of the Mindstorms Programming Software... I could just use a PID library instead of tediously transferring it into the graphical interface of the software
2
u/vlanins Feb 17 '19
This is pretty cool and inspiring! I have a rasperrypi but never did much with it.
1
u/mutemute Feb 17 '19 edited Feb 17 '19
Do a Pi-hole!
2
u/vlanins Feb 17 '19
thanks! Adblocking sounds pretty interesting.
btw, you are missing a colon after 'https' in your url. It leads to http://www.https.com which is some home improvement site and I was very confused haha. The url should be https://pi-hole.net/
1
1
Feb 17 '19
Would the bot wander less going in a straight line if the black line was narrower? Just curious. Awesome project!
1
1
1
Feb 16 '19
I've only ever done an intro to python course but I have no idea how you use python to program hardware...how does it work?? Explain like Im 5?
2
u/Jopakes3 Feb 16 '19
He programmed a raspberry pi, which has sensors connected to it, that it uses for input to control the movement.
0
0
Feb 16 '19
Some high schools have kids that are interested on making Python robots. My school has kids that smoke in class and think they're cool. #feelsbadman
-3
u/Darkwisper222 Feb 16 '19
My fundamentalist nature would force me to code it all myself. But good work on ctrlc gtrlv
-2
Feb 17 '19
Pretty good for highschoolers.
But you definitely can dump down the side of the robot. Maybe itβs not necessary to use a RPI at all. A simple Arduino would just do.
-10
u/ephem1235 Feb 16 '19
Doesn't work to well
5
0
Feb 16 '19
[deleted]
36
u/Marc_B7 Feb 16 '19 edited Feb 16 '19
We used the GPIO library. Here's a tutorial we used to to get the motor up and running:
http://explainingcomputers.com/rasp_pi_robotics.html
We used a color sensor to detect a white or black color. Here's a tutorial on that:
http://bradsrpi.blogspot.com/2013/05/tcs34725-rgb-color-sensor-raspberry-pi.html
4
u/iftoxicthengtfo Hatchling Feb 17 '19
to detect a white or black color.
Had a feeling that's what the tape was for lol
This is awesome!
6
u/SirBaum Feb 16 '19
I didn't build it. But in case it was buidl with pattern recognition, i would use OpenCV. Then only realize the black and white with a direction.
0
Feb 16 '19
[deleted]
43
u/Marc_B7 Feb 16 '19
We started out without barely any knowledge of python. We worked on it for a few weeks including learning python. Building the robot and testing it was done in a few days :)
0
Feb 16 '19
[deleted]
19
u/Marc_B7 Feb 16 '19
We tried working with opencv but it didn't give us the results we wanted. We taped a color sensor at the bottom to read white or black colors. For this we used:
http://bradsrpi.blogspot.com/2013/05/tcs34725-rgb-color-sensor-raspberry-pi.html
For the engine we used:
10
u/CyberNerd88 Feb 16 '19
I have to do this at the end of my current python class. How hard was it?