Thanks for this breakdown. This is a behemoth of a project that the crazy part of me wants to approach once I get more experience with Arduino. That solve almost seemed counter intuitive towards the end. It looked like the first two layers were solved, and then almost got completely jumbled, and I was thiking 'what the hell is going on' and then, BOOM! out of nowhere it's solved. Congrats on making it work.
I'd say it's more manageable than you'd think as its just a case of getting the components to communicate properly and arduino is great for that. It's the little bits like connecting motors to the cube that get you!
Can I contact you about this. I’m doing a similar project for a competition and I need some coding help. Let me know where to find the links to contact you please.
If I remember correctly the code I used activates 50 steps for a quarter of a turn, with each step taking 1ms so that would be 50ms. But I think I used 1.5ms in the final code (the speed in the intro) to avoid jamming
Hey Fred, I'm currently working on a similar project but im having trouble with the setup of multiple stepper motors. Is there any way I can get into contact with you to ask some questions on the specifics of your setup? Great video, thanks in advance
If you're using my code then you should be able to read the order from the bottom... Otherwise I'd suggest checking that the motors are wired to turn the right direction
Hey Fred, I have a question for you. I'm working on this school project where I decided to build and code the whole robot (i have no experience at all). I have one year to finish this project plus write an essay on the whole process and i was wondering how many hours a day you worked on it. As I said i have no experience at all and i would like to know if i can learn how to do this in one year. Thank you and great video btw.
I started this project to learn how to use an arduino so didn't have much experience either and it took me about 4 months from idea to finished prototype. Can't remember how many hours I spent daily but probably about 15-20 hours a week maybe, assuming I worked on it every day. If you haven't got much else to do at school then you probably could do it
Hi fred i have trouble with connect the motors to the cube. Can u pls give me the stl file for your connector because it seems like it will work on mine. Tnx
I hope you reply to me , I can not able to understand why this color sensor not present in the diagram? How it is solving without color sensor attached?, Thanks
The colour sensor was too sensitive to get the colour right every time so I replaced it with buttons. Unfortunately that means the machine needs you to tell it where the colours are (by pressing the buttons) and can't work it out by itself
@@muhammadmirza3825 it needs all the positions to start, I coded it with an easy sequence to remember. There is likely a way of coding it so that you only need to tell it a few of the positions but I didn't try that with this project
So when allocating the true colors (the ones truly on the cube) to their positions with the buttons (beneath the title of the colors they should exist at when solved). Do you just need to memorize the order in which you press the buttons?
How did you solved with the current flow to stop it when not sending any commands from arduino? Because the motors are always getting voltage due to A4988 and so,with 6 motors you get a flow of 4.2 amps without doing anything.
Yes that's true, if I remember correctly I think you can connect the enable pin to a digital pin on the arduino to toggle the a4988 outputs on and off to prevent any current draw. I only thought of this after soldering everything so mine is not wired like that, the a4988 logic is connected to the 5v regulator so I manually controlled the current draw by switching on and off the regulator
@@freddiemeinertzhagen yes thanks. I did that right after I posted the question with some code edit and pin 52 to each En pin of A4988. Now each motor has 50mAh on use and 0 on hold and in place of a regular power source, i mounted a Li-ion battery 12V of 25Ah so it can be portable. It works like a charm.
Hey Fred, loved your projetct !! I was just wondering how software did you use to create the simulation of the circuit on internet, thanks for your answer !!
That's pretty cool! How does the arduino not accidently remove other pieces while putting in one piece? asking because I don't think you were using algorithms
For example int yellowCrossAlgorithm(int x){ // f, r, u, ri, ui, fi if(x == 2){ // rc, gc, yc, ga, ya, ra redRotate90(); greenRotate90(); yellowRotate90(); greenRotateInvert90(); yellowRotateInvert90(); redRotateInvert90();
Hi Fred, I have an exact same set up but it burnt the voltage regulator on my arduino mega. I powered it using a 12V external supply which I tested before I hooked it up. After about 3 minutes of being on, it fried the regulator and now it can no longer turn on via external supply (haven't tried USB). Do you know why this happened? No visible damage to any of the components but I burnt my finger when I touched it after just a couple seconds of being on.
Hi, sorry to hear that! I suspect that the power supply actually isn't the issue, because as long as its 12V DC connected to the 5.5mm jack it should only draw as much current as it needs (also make sure the polarity is correct if you're wiring it manually). I checked my diagram in the video and it shows the arduino powered by supplying 5V to the Vin pin, if you connected 12V to that then it could be the problem. Definitely try a USB connection and maybe a much simpler test curcuit like some LEDs to see if that works, but if its getting that hot then it's unlikely to work again. Otherwise, I would have to see your setup to know if there is another problem. Another good practice (for future reference) which I haven't got in the diagram is to put a decoupling capacitor across the power supply to prevent voltage spikes from damaging components. My final circuit never had these and they worked fine, but there might be a chance that activating the motors caused a voltage spike and somehow damaged the arduino, but I had no issues with that as far as I'm aware. If you do any more tests, don't assume the diagrams in the video are completely safe because I only made them from what I learnt online. That being said, they worked fine for me. If you figure out what caused it, I'd be interested to know what it was!
Thanks for the reply! I connected the 12V using the adapter, not the Vin pin, everything is wired correctly. After a 30 min break or so, I tried it again and tested the voltage at the regulator and it was working again. What would cause it to turn off and not come back on again for a while? You had yours operating for more than 3-5 min at a time I'm sure so I don't see why it would overheat. Also I would like to specify that I had no motors connected and was only testing one driver to set the limiting current. So essentially I just had one driver chip on the bread board which was wired to the arduino
Hi Fred I'm trying to make the Rubik's Cube Solver myself but I am having trouble with the code. Can you share the code with me so I can try to figure it out and make it better if I can?
@@freddiemeinertzhagen Hi again I have a few questions, and some methods for faster solving. Probably the easiest way to make the solve faster is doing the most efficient turns to put the peace in the solved position. If you have not done that you could also use a more efficient method of solving the cube, the current fastest way to solve a cube is the CFOP method, so if you programed it to solve the peaces so it would always be the same OLL and PLL cases that could save a lot of time. Also if you could share the 2D and 3D files as well that would be great!
Amazing project, absolutely love it, Infact i would want to make one of these for myself, if you could help me with the stl files and code, it would be awesome
We (2 people) are starting the cube solve project using Python and Circuit Python. We are interested in your logic. Is there any way for us to get a copy of your (C) code?
There were meant to be colour sensors but I had to get rid of them for this machine because I couldn't design a decent retraction mechanism without overcomplicating it. The buttons were meant to be temporary but ended up staying
I had to input the colours using the buttons by pressing them in a particular order. Essentially I coded the arduino to assign the button pressed to a particular position i.e. the first button pressed assigned that colour to the top left square on the white face, the second button pressed assigned that colour to the top middle square of the white face etc. like at 11:55 in the video
Unfortunately the colour sensor was too sensitive to light to give an accurate reading, you open a window and all the values suddenly change. So I replaced it with buttons. They were meant to be a temporary solution but the colour detection turned out to be a lot of work to implement afterwards...
Also you would need a whole load of sensors, or a system to move one sensor around the cube which is pretty complicated. Most people manually do the colours like this or use a camera and raspberry pi
Hey Fred, your amazing video of your project inspired me, to try this on my own :) I have now basically everything in place, however there are two problems, for which I hope that you can help me... First of all, whenever I start the code, all the motors make a very loud turn in one direction, it isn't always the same amount of steps. Somehow the pins have to switch from LOW to HIGH in the setup part of the code? I have no clue why it does it... My second problem is, that the stepper motors make a noise, whenever the Arduino is plugged in and the external power source for the motors is plugged in as well. I checked my wiring several times and was just wondering if maybe you had a similar problem... Greetings from Switzerland^^
I don't know what you mean by starting the code since it starts automatically when you plug it in, but yes I think the arduino takes a moment to start up and when it does its pins seem to output random high and low signals, because my motors also jump around as soon as the arduino is connected to power. The way I got around it (there might be a better way) was just to turn the arduino on first, and then a second or so later, connect the 5V to the stepper drivers (that way you activate the motors after the pin voltages have settled). I was using a 5V voltage regulator to supply power to the VDD pin on the drivers, so all I had to do was plug the arduino into the 12V power supply first and then switch on the regulator. If I didn't turn the arduino on before activating the drivers, the motors would turn to a random angle and wouldn't be in line with the cube faces. I hope that helps!
@@freddiemeinertzhagen I figured something similar out on my own. I only plug in the 12V Power source, after the setup part is done. My machine is working now and I'm so happy :)
Hello, im a student and this is my final project…great video man I appreciate the excellent description but if i wanted to do the same project but i need it to be more simple than this one 💔 what shoud i do
Unfortunately this seems to be as simple as it gets, you can't really eliminate any of the parts without impairing the function. Perhaps you could remove the retraction motors and manually slide/screw the motors back and forth
Not only excellent work, but excellent description of design and construction!
Thanks for this breakdown. This is a behemoth of a project that the crazy part of me wants to approach once I get more experience with Arduino.
That solve almost seemed counter intuitive towards the end. It looked like the first two layers were solved, and then almost got completely jumbled, and I was thiking 'what the hell is going on' and then, BOOM! out of nowhere it's solved. Congrats on making it work.
I'd say it's more manageable than you'd think as its just a case of getting the components to communicate properly and arduino is great for that. It's the little bits like connecting motors to the cube that get you!
The "YES" after it finally worked the first time, I felt that
Awesome Work Dude. Really admire your work.
Thanks man!
No point, other than to prove your genius. Fantastic work, thank you for sharing.
Man, great job. you deserve more views.
Can I contact you about this. I’m doing a similar project for a competition and I need some coding help. Let me know where to find the links to contact you please.
Hi, I have a question at 6:30 , how fast is the motor there? (how much time the motor needs for one quarter move)
If I remember correctly the code I used activates 50 steps for a quarter of a turn, with each step taking 1ms so that would be 50ms. But I think I used 1.5ms in the final code (the speed in the intro) to avoid jamming
Hey Fred, I'm currently working on a similar project but im having trouble with the setup of multiple stepper motors. Is there any way I can get into contact with you to ask some questions on the specifics of your setup? Great video, thanks in advance
Hello, @Fred Meinertzhagen is there any way you can share the stp file of the laser cut parts you used in this project, please.
Can you share the stl files?
Hey Fred, can you please provide the laser cut files?
When you can’t afford a gan robot. But you have a genius brain 😂
can you share the code files
Como es que declaras los colores con los botones, es decir existe algun orden o se puede iniciar y finalizar con cualquier cara?
Yes it is expecting you to press the buttons in a specific order, which I decided
@@freddiemeinertzhagen and what is that order? I tried to do it but I can't solve the cube correctly
If you're using my code then you should be able to read the order from the bottom... Otherwise I'd suggest checking that the motors are wired to turn the right direction
Hey Fred, I have a question for you. I'm working on this school project where I decided to build and code the whole robot (i have no experience at all). I have one year to finish this project plus write an essay on the whole process and i was wondering how many hours a day you worked on it. As I said i have no experience at all and i would like to know if i can learn how to do this in one year. Thank you and great video btw.
I started this project to learn how to use an arduino so didn't have much experience either and it took me about 4 months from idea to finished prototype. Can't remember how many hours I spent daily but probably about 15-20 hours a week maybe, assuming I worked on it every day. If you haven't got much else to do at school then you probably could do it
Hi fred i have trouble with connect the motors to the cube. Can u pls give me the stl file for your connector because it seems like it will work on mine. Tnx
Hello, how do you go about taking the zero point of the stepper motors?
The code only rotates the motors from where they start, so their position when switched on is technically their zero angle
Good coffee ☕️, good work 👍
hi can i get the 3D model file pls? tnx
I hope you reply to me , I can not able to understand why this color sensor not present in the diagram? How it is solving without color sensor attached?, Thanks
The colour sensor was too sensitive to get the colour right every time so I replaced it with buttons. Unfortunately that means the machine needs you to tell it where the colours are (by pressing the buttons) and can't work it out by itself
Thanks one more question is that do we only need to input one side of the Rubik's cube and it will start solving or what? Thanks
@@muhammadmirza3825 it needs all the positions to start, I coded it with an easy sequence to remember. There is likely a way of coding it so that you only need to tell it a few of the positions but I didn't try that with this project
Excellent video, well done.
So when allocating the true colors (the ones truly on the cube) to their positions with the buttons (beneath the title of the colors they should exist at when solved). Do you just need to memorize the order in which you press the buttons?
How did you solved with the current flow to stop it when not sending any commands from arduino? Because the motors are always getting voltage due to A4988 and so,with 6 motors you get a flow of 4.2 amps without doing anything.
Yes that's true, if I remember correctly I think you can connect the enable pin to a digital pin on the arduino to toggle the a4988 outputs on and off to prevent any current draw. I only thought of this after soldering everything so mine is not wired like that, the a4988 logic is connected to the 5v regulator so I manually controlled the current draw by switching on and off the regulator
@@freddiemeinertzhagen yes thanks. I did that right after I posted the question with some code edit and pin 52 to each En pin of A4988. Now each motor has 50mAh on use and 0 on hold and in place of a regular power source, i mounted a Li-ion battery 12V of 25Ah so it can be portable. It works like a charm.
Hey Fred, loved your projetct !! I was just wondering how software did you use to create the simulation of the circuit on internet, thanks for your answer !!
Thanks! Circuit diagrams were made using Fritzing
@@freddiemeinertzhagen Thanks, have a nice day !
That's pretty cool! How does the arduino not accidently remove other pieces while putting in one piece? asking because I don't think you were using algorithms
I did use algorithms, I coded them manually using the same algorithms as in the instruction sheet
For example
int yellowCrossAlgorithm(int x){
// f, r, u, ri, ui, fi
if(x == 2){
// rc, gc, yc, ga, ya, ra
redRotate90();
greenRotate90();
yellowRotate90();
greenRotateInvert90();
yellowRotateInvert90();
redRotateInvert90();
@@freddiemeinertzhagen Oh, makes much more sense now, thanks!
Hi Fred, I have an exact same set up but it burnt the voltage regulator on my arduino mega. I powered it using a 12V external supply which I tested before I hooked it up. After about 3 minutes of being on, it fried the regulator and now it can no longer turn on via external supply (haven't tried USB). Do you know why this happened? No visible damage to any of the components but I burnt my finger when I touched it after just a couple seconds of being on.
Hi, sorry to hear that! I suspect that the power supply actually isn't the issue, because as long as its 12V DC connected to the 5.5mm jack it should only draw as much current as it needs (also make sure the polarity is correct if you're wiring it manually). I checked my diagram in the video and it shows the arduino powered by supplying 5V to the Vin pin, if you connected 12V to that then it could be the problem. Definitely try a USB connection and maybe a much simpler test curcuit like some LEDs to see if that works, but if its getting that hot then it's unlikely to work again. Otherwise, I would have to see your setup to know if there is another problem. Another good practice (for future reference) which I haven't got in the diagram is to put a decoupling capacitor across the power supply to prevent voltage spikes from damaging components. My final circuit never had these and they worked fine, but there might be a chance that activating the motors caused a voltage spike and somehow damaged the arduino, but I had no issues with that as far as I'm aware. If you do any more tests, don't assume the diagrams in the video are completely safe because I only made them from what I learnt online. That being said, they worked fine for me. If you figure out what caused it, I'd be interested to know what it was!
Thanks for the reply! I connected the 12V using the adapter, not the Vin pin, everything is wired correctly. After a 30 min break or so, I tried it again and tested the voltage at the regulator and it was working again. What would cause it to turn off and not come back on again for a while? You had yours operating for more than 3-5 min at a time I'm sure so I don't see why it would overheat.
Also I would like to specify that I had no motors connected and was only testing one driver to set the limiting current. So essentially I just had one driver chip on the bread board which was wired to the arduino
I found a short in the power bar of the breadboard which wouldve done it. Everything else working now!
Easily done. In fact I'm surprised the arduino still works, usually one short and it's finished!
Hi Fred I'm trying to make the Rubik's Cube Solver myself but I am having trouble with the code. Can you share the code with me so I can try to figure it out and make it better if I can?
There are still mistakes in my code but it is now in the video description 👨💻
@@freddiemeinertzhagen Thank you so much! If I can make any improvements then ill send it back.
@@freddiemeinertzhagen Hi again I have a few questions, and some methods for faster solving. Probably the easiest way to make the solve faster is doing the most efficient turns to put the peace in the solved position. If you have not done that you could also use a more efficient method of solving the cube, the current fastest way to solve a cube is the CFOP method, so if you programed it to solve the peaces so it would always be the same OLL and PLL cases that could save a lot of time. Also if you could share the 2D and 3D files as well that would be great!
Fred could i get full program of your project
Great video! Do you think you could share the code and stl files in the description?
Amazing project, absolutely love it, Infact i would want to make one of these for myself, if you could help me with the stl files and code, it would be awesome
We (2 people) are starting the cube solve project using Python and Circuit Python. We are interested in your logic. Is there any way for us to get a copy of your (C) code?
use kociemba algorithm
and um use maybe a camera with an rpi
Hey Fred, can you please tell me how much did this cost you
About £280 in total
@@freddiemeinertzhagen ahhh that’s a lot
Where did you used the colour sensors
There were meant to be colour sensors but I had to get rid of them for this machine because I couldn't design a decent retraction mechanism without overcomplicating it. The buttons were meant to be temporary but ended up staying
Without using if.. How did you get the positions of the colors.. ?
Do you scan it everytime with the sensor,before giving it to solve?
I had to input the colours using the buttons by pressing them in a particular order. Essentially I coded the arduino to assign the button pressed to a particular position i.e. the first button pressed assigned that colour to the top left square on the white face, the second button pressed assigned that colour to the top middle square of the white face etc. like at 11:55 in the video
well done great video...
Can anyone give me the full code?
Hello Fred, could you share the code with me by any chance. I want to recreate your cool project but unfortunately have a tight deadline.
There should be a Google drive link with the code in the description
@@freddiemeinertzhagen oops this is embarrassing. Thanks 😅
@@freddiemeinertzhagen Different question. I don't quite get where you built in the color sensor.
Unfortunately the colour sensor was too sensitive to light to give an accurate reading, you open a window and all the values suddenly change. So I replaced it with buttons. They were meant to be a temporary solution but the colour detection turned out to be a lot of work to implement afterwards...
Also you would need a whole load of sensors, or a system to move one sensor around the cube which is pretty complicated. Most people manually do the colours like this or use a camera and raspberry pi
Hey Fred, your amazing video of your project inspired me, to try this on my own :) I have now basically everything in place, however there are two problems, for which I hope that you can help me... First of all, whenever I start the code, all the motors make a very loud turn in one direction, it isn't always the same amount of steps. Somehow the pins have to switch from LOW to HIGH in the setup part of the code? I have no clue why it does it...
My second problem is, that the stepper motors make a noise, whenever the Arduino is plugged in and the external power source for the motors is plugged in as well. I checked my wiring several times and was just wondering if maybe you had a similar problem...
Greetings from Switzerland^^
I don't know what you mean by starting the code since it starts automatically when you plug it in, but yes I think the arduino takes a moment to start up and when it does its pins seem to output random high and low signals, because my motors also jump around as soon as the arduino is connected to power. The way I got around it (there might be a better way) was just to turn the arduino on first, and then a second or so later, connect the 5V to the stepper drivers (that way you activate the motors after the pin voltages have settled). I was using a 5V voltage regulator to supply power to the VDD pin on the drivers, so all I had to do was plug the arduino into the 12V power supply first and then switch on the regulator. If I didn't turn the arduino on before activating the drivers, the motors would turn to a random angle and wouldn't be in line with the cube faces. I hope that helps!
@@freddiemeinertzhagen I figured something similar out on my own. I only plug in the 12V Power source, after the setup part is done. My machine is working now and I'm so happy :)
Hello, im a student and this is my final project…great video man I appreciate the excellent description but if i wanted to do the same project but i need it to be more simple than this one 💔 what shoud i do
If you can give me your email so when can discuss how to do similar but simpler project that would be great
Unfortunately this seems to be as simple as it gets, you can't really eliminate any of the parts without impairing the function. Perhaps you could remove the retraction motors and manually slide/screw the motors back and forth
I hope i can do like this one day 🙄
Gracias bro
Not trying to be an asshole, but for all those of statements, you could of saved each peice in an array, then used indexes.
Hi fred!
😂😂