Is there a way to reuse an old robot using arduino?

I had purchased a simple robot (named Qu-Bot) for a school project a couple of years ago. After the project, it just went into the attic. A few days ago, I purchased an Arduino Uno and started learning the how to operate it. But, before I could purchase LEDs, sensors, LCD, etc, a total lockdown was implemented in my country due to coronavirus.

Is there a way I could program that old robot in Arduino IDE like I program my Uno?

I'm not sure if this is useful or not, but, when I execute $ lsusb , the bot appears as Bus 001 Device 018: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Here's a link to some documentation of the bot: http://www.technogravity.com/products/qu_bot/qu_bot_downloads.php

Here are photos of all the 3 chips I can see on the board of the bot:

Put your efforts into learning to program the Arduino.

Watch the video offerings on YouTube.

Trying to repurpose existing hardware can be difficult at best.


Arduino links of interest.


How to use this forum:
https://forum.arduino.cc/index.php?topic=149014.0


Listing of downloadable 'Arduino PDFs' :
Either Google >>>- - - - > arduino filetype: pdf
Or
https://www.google.ca/search?q=arduino+filetype%3A+pdf&rlz=1C9BKJA_enCA739CA739&oq=arduino+filetype%3A+pdf&aqs=chrome..69i57j69i65.1385j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8


Listing of downloadable 'C++ PDFs' :
Either Google >>>- - - - > C++ filetype: pdf
Or
https://www.google.ca/search?q=c%2B%2B+filetype%3A+pdf&rlz=1C9BKJA_enCA739CA739&oq=c%2B%2B+filetype%3A+pdf&aqs=chrome..69i57.22790j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8


Arduino cheat sheet:


Watch these:
Arduino programming syntax:

Arduino arithmetic operators:

Arduino control flow:

Arduino data types:

Jeremy Blume:

Sparkfun External Interrupts

Sparkfun Timer1 Interrupts

Powering Your Projects


Understanding Destructive LC Voltage Spikes:

OR

Why MOSFET gate resistors:


Some things to read

LCD information:

Reading a schematic:
https://learn.sparkfun.com/tutorials/how-to-read-a-schematic

Language Reference:
https://www.arduino.cc/en/Reference/HomePage

Foundations:


How and Why to avoid delay():
http://playground.arduino.cc/Code/AvoidDelay

Demonstration code for several things at the same time.
http://forum.arduino.cc/index.php?topic=223286.0


Multitasking:
Part 1:

Part 2:

Part 3:


Neopixels, Adafruit

Fastled


Sparkfun Tutorials:
https://learn.sparkfun.com/tutorials?page=all

Micro Controllers:

Useful links:

Arduino programming traps, tips and style guide:
http://www.gammon.com.au/forum/?id=12153

Call for useful programming discussions

Arduino products:
https://www.arduino.cc/en/Main/Products

Motors/MOSFETs
http://www.gammon.com.au/motors

Switches:
http://www.gammon.com.au/forum/?id=11955

A good book you might want to get:


Share tips you have come across, 500+ posts:


Debug discussion:

Frequently Asked Questions:
https://www.arduino.cc/en/main/FAQ#toc10


Number 'type's:

  • boolean (8 bit) - simple logical true/false, Arduino does not use single bits for bool
  • byte (8 bit) - unsigned number from 0-255
  • char (8 bit) - signed number from -128 to 127. The compiler will attempt to interpret this data type as a character in some circumstances, which may yield unexpected results
  • unsigned char (8 bit) - same as 'byte'; if this is what you're after, you should use 'byte' instead, for reasons of clarity
  • word (16 bit) - unsigned number from 0-65535
  • unsigned int (16 bit)- the same as 'word'. Use 'word' instead for clarity and brevity
  • int (16 bit) - signed number from -32768 to 32767. This is most commonly what you see used for general purpose variables in Arduino example code provided with the IDE
  • unsigned long (32 bit) - unsigned number from 0-4,294,967,295. The most common usage of this is to store the result of the millis() function, which returns the number of milliseconds the current code has been running
  • long (32 bit) - signed number from -2,147,483,648 to 2,147,483,647
  • float (32 bit) - signed number from -3.4028235E38 to 3.4028235E38. Floating point on the Arduino is not native; the compiler has to jump through hoops to make it work. If you can avoid it, you should.

You should always select the 'data type' best suited for your variables.
ex:

  • your variable does not change and it defines a pin on the Arduino. const byte limitSwitchPin = 34;
  • since an analog variable can be 0 to 1023, a byte will not do, you can select 'int'. ex: int temperature;
  • if your variable needs to be within -64 to +64 a 'char' will do nicely. ex: char joystick;
  • if your variable is used for ASCII then you need type 'char', ex: char myText = {"Raspberry Pie Smells"};
  • if your variable enables some code then boolean can be used. ex: boolean enableFlag = false;
  • millis() returns the time in ms since rebooting, ex: unsigned long currentTime = millis();
    etc.

Oh, and have fun too :slight_smile: !

“Is there a way I could program that old robot in Arduino IDE like I program my Uno?”

Maybe you can look at the various functions performed by the old robot software/hardware, and look for similar functions that can be performed by an arduino.

One thing you can do is take the ATMega16 out of the robot and wire the Uno to the socket (if you have leads).

Trying to program the ATMega16 using the IDE might be possible; there are however a number of dependencies that will determine what is possible (outside my area of expertise).

Below the schematic of the board (basics); as indicated in the notes in the zip, some parts are proprietary and not in the schematic

Looking at the schematic of that robot it seems very simular to an arduino with some peripherals.
An interesting stuff.

Did you try to address it in the Aduino IDE as being an Uno?

It MAY work... else you will very probably need to load an Arduino bootloader.
For that you will need another UNO and follow the instructions to use an Arduino as programmer.

You may be better off, upon trying to use the AVR of the UNO plugged instead the AVR of the robot.

RIN67630:
You may be better off, upon trying to use the AVR of the UNO plugged instead the AVR of the robot.

Trying to fit a 28pin 300mil IC (328P) in a socket for a 40pin 600mil IC (ATmega16) is not that easy. Especially of due to lockdown one can not get what one needs :wink:

Going by the diagram posted by sterretje, it looks like the robot is (probably) programmed the same way as the arduino. That is, the robot has a USB to serial converter on board (the part PL2303) which connects the host computer to the serial ports on the ATMega16. Notice the RXD, TXD and RST terminals on the PL2303? They go to the corresponding terminals on the ATMega16. Presumably the ATMega16 has a bootloader pre-installed.

When you upload a program, the PL2303 uses the RST line to reset the ATMega16. Whenever the ATMega16 starts up, the bootloader runs before the user's code. The bootloader checks the serial port to see if a new program is being sent to it. If not, it runs whatever code the user has already installed, if any. If it does detect a new program being sent to it on the serial port, it will write it to program memory. The PL2303 will then send another reset signal. The bootloader will run again, but this time it will not have anything to write to memory and the ATMega16 will run the code you just uploaded.

I don't know if you can set the Arduino IDE to target an ATMega16, so you mightn't be able to use the Arduino IDE. But have a play around.

It turns out the Arduino IDE just invokes some standard tools to compile your program and upload it. Connect up your Uno to the Arduino IDE. In the Arduino IDE settings, turn on verbose output during compilation. Then upload something to the Uno. In the window, you'll see the commands the Arduino IDE uses. It invokes a cross-compiler called avr-gcc.

Do the same with verbose output during upload. You'll see that the Arduino IDE invokes a program called avrdude that does the upload. If the bootloader on your robot is compatible with the Arduino bootloader, I think avrdude could upload a program your robot over the USB port. Maybe someone else can confirm this.

Here's what I think you should try:

The steps are 1. Create a complied binary for your target processor, and 2. Upload it to the board. Practice with your Uno first . Start by creating a compiled program for your Uno using the Arduino IDE. Use the blink program or similar and click on sketch > export compiled binary. Then see if you can upload it to your Uno using avrdude. Search online for using avrdude with arduino.

Then when you've got it working with your Uno, try with the robot. You'll need to create a compiled program that targets the ATMega16. If you can't do that with the Arduino IDE, you could search for how to use avr-gcc, but you'll probably find it easier to use an IDE that works with the ATMega16. For instance, have a look at Atmel Studio on Windows. Or perhaps platformIO would work (I've not tried it). Export your compiled program, and try uploading it using avrdude.

Good luck :slight_smile:

I managed to load the Arduino bootloader into the chip. The blink program worked successfully using my Uno as FTDI (https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard). However, when I try to use the USB port (Prolific PL2303) builtin my bot, it says:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding

Another observation: As soon as I click upload, the LED, which had been blinking due to blink program, it stops blinking.