Rustic Engineering

My Mind working on…

Posts Tagged ‘PIC18LF452

GUI Bot, a overview…

with 10 comments

I few months ago, I started a prject of a little robot, to be able to self study some control, resolve maze algorithms and do something fun. The robot needs to be small with very quickly and smart movements.

The prototype was a success, made with some materials that I already have and with little issues, work’s great!. It can do:

  • Move, turn and gyro with speed and agility;
  • Speed up and Stop when you need;
  • Generates little sounds/alerts (and some music too, like a old cell phone);
  • Detects and follow a black line over white plane;
  • Easy programs changes, via USB/Serial adapter connection and a bootloader on the microcontroller;

This is my prototype, called GUI v1 (honor my son, Guilherme), build with universal PCB and some wires:

nice work!

Lithium Battery (like the new cell phones)

some wires...

The chassis was made with PCB it self, because I don’t like spend time to find some special enclosure to it. The universal PCB was cutted with Dremel and all components are soldered with a common solder iron. I need to confess: when the prototype was finished, it’s length and robustness impressed me. I don’t spect. See it in action:

After some tests that comprove some abilitys, I started to design a well polished and projected PCB. Now the hard work begun. I used Eagle software to design the circuit and PCB, but I don’t have all parts I want. So, I’ll go at SparkFun to find some devices I like to use in the robot. They have all really nice stuff you can think.

The processor (a Microchip PIC18F452) running at 20MHz and control motors speeds, LEDs, Buzzer, Wireless and all the embbeded stuff. It’s using a Bootloader to facilite the program upload, so the user don’t need complex flash programers to load their own software on the board. Just compile your program and upload via USB cable using a serial program like Hyperterminal or Putty.

Now, with the PCB designed, I’m going to BacthPCB and ordering some pieces. BacthPCB do a nice and decent job to amateurs designs, because they accept even a one board was order. The time to process your order is about 20 days. You can view my design (up board) and the processed PCB below:



After have almost all parts soldered and load some basic program to test, the result is:

low profile...



It’s power come from a little 3,7V Lithium-Polymer battery, charged via USB mini-B connector. I’m calculating the robot autonomy, as son as possible I’ll post this important data.

And if you can see this little robot in action:

As you can see, your movements are clean and fast, but with the control it’s can be smooth and slow. Now I need finish the Wireless comunication. I’m wonder if the program upload can be done via wireless…

The total cost of the robot it’s about $200 (excluding post services of board and components). The robot don’t stay in comercial prodution…maybe after some corrections and testes I change my mind.

Written by forrequi

February 1, 2010 at 17:20

GUI v2 – Final

with 2 comments

It’s finished! (almost). The Motor Board PCB arrives and I’ve soldered all components together. The final results looks awesome to me! Most beautiful that I’ve planed. There’s some parts that I don’t solder, because I need purchase a SMD rework station (all solders on this robot are made with a ordinary solder station).

GUI v2

GUI v2

GUI v2 - Power ON!


I found two problems with this design:

  • I’ve used the RA4 pin of PIC18LF452 for digital I/O, but unfortunately according to datasheet, that pin is a open drain. To operate like a common digital I/O it’s need a pullup resistor, but I don’t put it on my design. I need to solder the pullup 10kΩ SMD resistor. Lesson: All the times, read the entire datasheet before use any device pin.
  • In my Eagle motor library, I don’t provide horizontal restrictions to the motors area. Then, a little decouple capacitor stay above the motor, touch the white bracket motor house. This make a bad contact between boards. This capacitor it’s for crystal stabilization, so I removed it.

Well, even with all the issues:

  • Inverted connectors on boards;
  • Capacitors with wrong package (remember: 3406 don’t is 0603!);
  • Open drain pin without pullup;
  • Parts that I can’t found where purchase them;

… I think the whole project was a success. The robot works well, silent, smoothly. They are solid, very small and useful. The final result is a perceived evolution of the prototype, you see next:

Prototype and Final

Prototype and Final

GUI v2 - two boards

That’s the video of your first tests:

Now, the wireless part (NRF24L01+ transducer) waits to be soldered. It’ll on the party next month. So, the whole project has been closed and I’ll work on the software development, that I only write a very basic functions for test and maze solves.


Written by forrequi

November 7, 2009 at 11:12

GUI v2 – part 1

with one comment

When I start the PCB design I’ll think that some modifications can be done, like that a more power MCU and other goodies, like wireless communication.

Today most of DIY electronics projects use ZigBee or XBee for wireless communication. But i like to use a very low power device. I think that use one of the devices from Nordic, like nRF2401 or nRF24L01+ is a good choice. They aren’t full-duplex, but it’s don’t become a problem to me because most of I want is for telemetries, where the robot send data and receive in distinct moments.

This is nF24L01+ characteristics:

• 11.3mA TX at 0dBm output power
• 13.5mA RX at 2Mbps air data rate
• 900nA in power down
• 26µA in standby-I
• On chip voltage regulator
• 1.9 to 3.6V supply range
• On-air compatible in 250kbps and 1Mbps
with nRF2401A, nRF2402, nRF24E1 and
• Low cost BOM (Bill Of Materials)
• 5V tolerant inputs (everyone like devices with tolerant inputs)

After much headache I’ve finished the design of the two boards. I’ve made some mistakes with the design and some of mistakes I only know when the boards arrive to me. I’ts very frustrating…

Some of these mistakes besides on design with components that you don’t have in your hands or that you can’t find to purchase. This is a tip for everyone starting a new design: only use components that you really now where obtain. Some parts may appear to be easy to find, but they don’t.

Because some of that mistakes the controller board is finished but the motor board not. View the pictures:

This a video with the board in test.

The motor board, with the motors, h-bridge and other parts are in late because a great mistake: one of the connectors between boards are reversed (Duh!).

Was soon the motor board comes I’ll post the final mount and tests.

Next post I’ll show circuit details. Bye.

Written by forrequi

October 25, 2009 at 16:01

GUI v1 – Final Protype

leave a comment »

After so much solder and wires, I’ve finished my prototype with a great degree of quality:

This is a little video demo:

Disassembled boards:

Than, after this little challenge, I started to design a professional PCB for my robot. I used the great Eagle for that. I’ll post more brief.

Written by forrequi

October 25, 2009 at 14:33

GUI v1 – part 2

with 4 comments

Continue from part 1…

About the H-Bridge and motors.

There’s a lot of H-Bridge CI’s on market today. The most used on DIY robots are:

My experiency with SN754410 is good. It’s a good device, friendy DIP package (don’t say the same about L298). But (always there’s a “but…”) it’s have a great voltage drop across the internal transistors. If you put 6V at Vmotor and a 1A load, you get Vmotor – 2V, so only 4V to the motors. For my robot I want a more efficient H-Bridge. L298 and L293D are bigger devices, have the same problem than SN754410 and… I hate L298 package. So, I move to a new device.

Fortunately, at same time I find the Toshiba’s TB6612FNG dual motor driver. It’s a really nice device, with a good package (SSOP24 300MIL). TB6612FNG specifications:

  • Motor voltage (VMOT): 4.5 – 13.5 V
  • Logic voltage (VCC): 2.7 – 5.5 V
  • Output current maximum: 3 A per channel
  • Output current continuous: 1 A per channel (can be paralleled to deliver 2 A continuous)
  • Maximum PWM frequency: 100 kHz

Pololu have it in a nice breakout board, very friendly (above). After some test, they are chosen for GUI v1.


TB6612FNG H-Bridge

Written by forrequi

September 7, 2009 at 23:57

GUI v1 – part 1

leave a comment »

GUI v1 is little robot I was design over the last months. I have already made some other robots, but I don’t even finishing most of them. This design has various issues, and challenges. But it’s almost finished. Now I’ll post some steps of your design and construction. If you like it, visit my project page a LetsMakeRobots. It’s a awesome site with a lot of robots and good people.

First, going to my desires: I want a little robot, with little wheels and little motors. They need to be battery powered, but a little battery.

Some things I want my robot to do:

  • Line following;
  • Maze resolve;
  • Wireless communication;
  • USB wired communication;
  • Self-charge your battery;
  • Have a lot of LEDs (because LEDs are fun!);

So, with this great inspiration I begin it’s prototype. Maybe what I said now sounds a little amateur, but, when I have started, I don’t have a clear idea of how the final robot looks like, but I knew that your lines should be clear, without wires growing up.

I hate deals with hardware, so I decide that for the robot body I want use a PCB. The initial result was good enough to encourage me:

GUI PCB Based Body

Now, the nightmare begin: solder every part to PCB and wire all. I like, but I hate this.

The robot have the follow parts:

  • PIC18F252 was MCU, running at 20MHz;
  • 7 reflectance sensors, QTR-1RC;
  • Dual Motor Controller, TB6612FNG;
  • 2 Micro Gear Motor 30:1;
  • Step-Up converter, NCP1400 for 5V;
  • 3.7V LiPo battery;

About the MCU:

The PIC18F252 has the PIC Tinybootloader inside, for speed up the code development. Bootloaders have their issues, but my design is for a robot with easy upgrade capabilities. I like that everyone how like to change their software, can do this without bought a PIC programmer.

I don’t use all pins, but a think that for the final version, some other PIC is a better choice (like PIC18F452).

About the sensors:

The reflectance sensors are the QTR-1RC from Pololu. They have a QRE1113GR, that is a emitter-receiver pair. Pololu sells this sensor with two versions, one digital and other analog.

The digital version translates the reflectance into the capacitor discharge time, so with a common digital I/O port, and a counter, you can differentiate from a  White surface (more reflective) from a Black surface (less reflective).  The circuit below is show their use with a ordinary digital I/O on the MCU:

Reflectance Sensor - Digital Use

The analog version (QTR-1RA) needs a ADC line on MCU. Most of MCUs today have one, so don’t worry about your choice.

Now I have to sleep. Tomorrow I’ll post the next steps. Bye.

Written by forrequi

September 7, 2009 at 04:21