You are browsing as a guest. Sign up (or log in) to start making projects!

R2D2 model

Hardware
  • 16 Devlogs
  • 34 Total hours

A downscaled R2D2 model, which is capable of rolling, and has some flashy lights

Open comments for this post

3h 52m 1s logged

So this time, I’ve had to update the entire code. So, as I’ve told you guys in my previous devlog, I’ve tried to make R2 wireless with UDP, but it did not work for some reason. Because of this, we decided to try another method. We will host a web server on the Pico! My friend, who knows this stuff, will write a basic HTML code, with buttons, to control R2. For this, I’ve had to go down a little rabbit hole with youtube, google and gemini, to learn how actually this stuff works. After, and along with researching, I’ve had to change a little the structure of my code, and implement new features. I also added LEDs this time! I think the coolest feature is, that R2 will tell us with Morse his IP address, using his LEDs (because he will have different ones based on which wifi network he is currently connected to, and he will have no other way to tell it us). We’ve also made some crucial changes. At first we’ve wanted R2D2 to have sounds, but we will have to omit this one for now, because our lack of time. Also, rather than random flashing, each LED will have it’s own purpose, and they all going to be used for communication.

0
0
2
Open comments for this post

2h 39m 36s logged

So this time, I’ve tried to test the wireless part. I started by downloading a UDP app on my mom’s phone, and rotating the stepper motor with that, but nothing happened. After this I’ve rewritten the code so it does nothing with the motor, but prints the text in the UDP pockets, but still nothing. I’ve downloaded Packet Sender to my laptop, but still nothing. The UDP packets did never reach the Pico. I’ve tried everything the Debug Master Gemini said for more than two hours, but nothing… I think I will ask my friend who is familiar with making websites to write me a lightweight HTML page with buttons, then somehow make it connect to the motor logic. I reallyyy hope that will work.

0
0
17
Open comments for this post

38m 49s logged

Today I tested the battery voltage measuring feature, I last time made! I put in the batteries, wired it up, copied this specific part of the code in Thonny, told it to print the voltage, aaaannd when I checked with the multimeter, it was waaay off, lol. I was baffled, because the voltage my Pico measured was MORE than a full volt below the actual voltage. I immediately started researching, (by asking Gemini… of course…. I start to feel guilty for all the trees and water I waste), and it said to me that it is likely due to resistors are not perfect, this is why they have a TOLERANCE band, and I should start a different approach. It suggested that I should calculate a factor, by dividing the voltage of the batteries measured with a multimeter, by the raw ADC value my Pico reads, then multiply with that with the raw ADC value. After fixing this, it gave me roughly the exact value my multimeter had shown. P.S. If I could learn for once, that I HAVE to use period at decimal numbers, instead of comma, I would spend way less time searching for bugs that don’t exist…

0
0
9
Open comments for this post

3h 43m 50s logged

This time, I made the main power lines of R2D2! I started by soldering 3 wires (three positive, and three ground) to the battery holder, which will be the cozy home of two 18650 Li-Ion batteries. I connected a 5 volt buck converter to one of the lines, which will power the Pico, and a voltage divider to the next one, to help the Pico measure the batteries’ voltage, and give me a warning (eventually using R2’s LEDs) of low voltage. There is not connected anything yet to the third line, because the motor driver will be powered using this, but that soldering would be really hard with my setup, and I don’t know if I could safely do it. So I think I will ask an adult acquintance of mine, who works with electronics, to do that one for me.

0
0
7
Open comments for this post

5h 5m 57s logged

This time, I’ve finally made the wireless part! I started by, as you probably guessed it already, by brainstorming with Gemini! I asked it to give me tutorials on youtube, on how to make my robot wirelessly controllable, since I have a Pico W, as well as explain it himself. At first, I’ve went down a little rabbit hole, because I wanted to build a simple website, with buttons, to control R2D2. I quickly realized after peeking into college-level tutorials, that it far exceeds my capabilities at the moment, so I asked my good ol’ friend, Gemini, to give me a bit of a simpler solution. After some deep discussions, and watching a nice old man on youtube explaining it, I decided on non-blocking UDP socket polling, with the help of an external app. This will work by downloading an app to my phone (or anyone’s phone, who wants to control R2), agreeing on an ip address, and port number, then typing the letters, which represents the w, a, s, d, etc. keys. It may not look pretty, but it’s just as effective, and MUCH simpler.

0
0
6
Open comments for this post

1h 23m logged

Today, I added the sensor for the homing sequence of R2’s head! This way, at startup, the head will start to turn, until it hits the infrared sensor, then go back to the middle. This way it is ensured, that no matter what position was the head at startup, it won’t go beyond the safe limits

0
0
14
Open comments for this post

2h 8m 38s logged

So this time, I finally wired everything for the stepper motor-powered head together! I copyed the part which controls specifically this from my entire code sitting VSCode, just to try this out. I had an old battery holder saved from a toy, to make an external power source, and wired everything together. I checked the wiring with Gemini, to make sure I don’t light anything on fire. After this, well, it did not work… I spent brainstorming, “debugging”, and checking everything twice, until I realized the “bug” which prevented the motor spin, was the very common “missing battery” error. So I put it in, and after some fine tuning on the code, it worked really nice

0
0
13
Open comments for this post

58m 28s logged

This time I coded the homing sequence, which will help R2 center it’s head using the stepper motor. There will be an infrared sensor in the head, and at startup, R2 will turn its head slowly left, until the sensor detects it, and after this, the code will set the step count to 0. After this the head will automatically turn to look forward, while counting the steps. This is necessary to ensure that the head will move only in the safe limits, no matter in which position it was at startup. I took the help of Gemini at debugging.

0
0
21
Open comments for this post

4h 54m 55s logged

This time, I collected multiple days’ work for this devlog. I started by brainstorming with Gemini (by now I must be their top user, lol) about what motor would be best for turning R2’s head. We’re planning LEDs in the head, so I had to make sure it cannot rotate all the way around, because this would break the wires. I came to the conclusion, that a custom 3D printed gear mechanism would be best, with a 28BYJ-48 stepper motor, and a ULN2003 board, and rotation limits in the software. I watched videos on Youtube, and also asked Gemini to explain to me how to write a code to control the stepper motor. The code is not yet complete, I’ll have to add a “homing mechanism”, which would help the head find it’s position at startup.

0
0
18
Open comments for this post

1h 39m 1s logged

Today I wrote the prototype of the code, which will control the motion of R2D2. The original version will control it wirelessly, along with the sounds and ligths, but this controls only the motors yet, via a microUSB cable. I wrote it in VSCode, and I will only copy it to Thonny (which i’ll be using for the Pico) when it is fully completed. I took the help of Gemini, to explain me how to control it (the robot, eventually) using my keyboard, and with the final debugging. I also watched Electro Nerds Academy’s youtube video in the process, which explains how to control the TB6612FNG motor driver with Arduino, and C++, I did this to make sure I understand the process. I still have a lot to learn, but slowly and surely, R2 will roll!

0
1
27
Open comments for this post

1h 19m 14s logged

Today, I got the Pico!!! Immediatelly I started to load up micropython on it, and download Thonny. It was a bit tricky, because my antivirus program wouldn’t let me download it, but I disabled it temporarily, and it worked just fine. And I quickly reviewed the first few pages of my PDF book, to make sure I know my Pico physically, not just the Wokwi version. After that I wanted to try it out with the onboard LED, but it didn’t worked, so I asked Gemini. I found out that my Pico, is actually Pico W, and the onboard led is a little different. After that it worked beautifully. Then I wanted to light up an external LED, and guess what, it also didn’t work! I started troubleshooting with Gemini on my side, and I found out, that my breadboard’s ground rail is probably damaged. After rewiring to bypass it, it lighted up!

0
0
5
Open comments for this post

50m 16s logged

A problem occurred during the delivery if the Pico, so it got retured to the sender. We had to order it again, so until it arrives, I thought I could learn actually how to control the DC motors with it, with the help of a TB6612FNG motor driver which we will be using. I asked Gemini to explain it to me, without providing exact codes, to ensure I actually understand the code, and not just copy-pasteing. It gave me a great youtube tutorial too, from Electro Nerds Academy, which used Arduino (and therefore C++), but it helped me understand the core principles of the wiring, and the code

0
0
9
Open comments for this post

1h 13m logged

So today, while I was STILL waiting for the Pico, I built a reaction time based game, and a burglar alarm in Wokwi, with the help of the PDF book I’ve mentioned before. By this, I’ve learnt how to use the urandom library in Micropython, which I think will be really useful with R2D2 ‘s flashing lights, and sounds, and with the burglar alarm I’ve learnt how to connect, and use a sensor with the Pico. Putting sensors in R2D2 is a secondary, and a long-term goal, but it would be really nice. I hope that after this, I’ve learnt the basics of Micropython, so I think I’ll start focusing on our actual project, R2D2. (I don’t know when will the Pico arrive, so this is a major limiting factor)

0
0
4
Open comments for this post

1h 24m 40s logged

So, today I’m still waiting for the Pico, so I’m still using Wokwi, and the PDF book, to learn, and practice. Today I’ve made a traffic light, which is working by continuously alternating red, yellow and green lights. It worked just fine, until I added a feature, so when a “pedestrian” pushes a button, a buzzer makes 10 beeps, and the light switches to red for the “cars”. This seemed to be too much for Wokwi, and it kind of crashed, so I relied on the PDF book, to verify the code, and the wiring.

0
0
3
Open comments for this post

1h 11m logged

Today, I was still practicing Micropython, and connecting circuits in Wokwi’s Raspberry Pi Pico simulator, with the help of the “Get Started with MicroPython on Raspberry Pi Pico” book. I’m still waiting for the delivery, so I can’t do it physically yet, but I think it’s still a great way to learn, and it even lacks the risk of frying anything. I succesfully made an LED blink, and connected a four-legged push button to the Pico. The final “project” of this session was building a circuit, so when you push the button, the LED lights up. I had a little problem with this, so I took the help of Gemini, and we figured out, that I accidentally connected the button to the Pico’s 3V3 EN pin, instead of the 3V3 pin, and I had a missing colon in the code. After fixing, it worked beautifully

0
1
10
Open comments for this post

1h 8m 32s logged

Today, I started to learn micropython for the Raspberry pi Pico WH, which I will use for my team’s R2D2 model. I do not have one yet, im currently waiting for the delivery :) , but I used Wokwi’s Raspberry pi Pico simulator, and the PDF micropython tutorial book, which I found on the original Raspberry Pi website. (well, not exactly there, because it showed me error 404, but I found it on Internet Archives, it’s title is “Get Started with MicroPython on Raspberry Pi Pico”). With the help of these, I learned how to import libraries in micropython, and how to turn on the Pico’s onboard LED. I even programmed it to stay on for a certain amount of seconds. I also used VS Code to try out some basic python loops.

0
1
32

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…