ZROBOT iPhone controlled Wi-Fi robot
The internal FLYPORT webserver allows an iPhone to control the Robot using Safari. Next step is a add a camera onboard! The video shows how a robot is connected to an iPhone using an openPicus FLYPORT module. Webpage with buttons and bar indicators is stored in the PIC 24F based web-server.
The development made with Pinguino compiler on the Robot processor side, with openPicus IDE on WIFI side. The robot is controlled with Picstar board a 18F based microcontroller board from Z-Control.ch
This project is a new version of the original Flyport-Picstar project. In order to simplify the robot architecture, all fonctions that originally worked on the Picstar (Z-Control) board where moved to the flyport. Functions currently include: Robot direction and speed control over Ad-Hoc web page i.e. Iphone. Interrupt driven IR distance sensor, display of distance on WEB-Page. Battery mesure and display on web page. Switch off motor on low-battery level was added to the original design.
Flyport connected to a Vero-Board. H-Bridge, Flyport connector, Power-Switch, resistors for battery mesure on-board. ROME DC motors connected to the Vero-board, IR sensor on separate PCB available from Zigobot.ch. Details shown on schematic below.
The Z-Robot works with an Ad-Hoc connection, meaning only one can control the robot at a time. The SSID of the robot is Zrobot. The web-page ip address is 192.168.1.115.
The web interface consists of one battery bar showing the status of the battery. The interface maybe improved with colors showing green/red for a certain level of battery. The next part shows 3 bars that represent the IR sensor status, as shorter the bar as closer the obstacle. The rest of the interface are push-buttons to driver the motors, forward, backward, stop, left and right allows you to send instructions to the flyport. On the application side, each button has his proper id that will be turned into instructions to the PWM générator of the flyport.
As the flyport is not able to power 500mA motors directly, H-Bridges have been used to drive the 2 motors on the robot. For each motor, we have one H-Bridge that has 2 input pins and 2 output pins. Input pins are connected to 2 dedicated PWM channels allowing the flyport to send pulsed to drive the motor in forward or backward direction. We will always use one of the 2 pwm signals to driver the motor. The choosen circuit L293D to drive the motor. This chip allows to drive 2 motors up to 20V which perfectly fits to our needs. Also if you check the schematics, you will note that the H-Bridges are powered directly from the battery (2cells lipo in my case) and driven by the 3.3v pwm signal to the circuit signal input. Please note that VCC1 should be connected to 5V, VCC2 to the battery voltage up to 36V are possible.
The basic idea of the IR sensor is to stop the robot when it identifies a table border or a horizontal obstacle. I used a small IR sensor (LIT301) that has the IR emitting diode and the IR receiver integrated. Both have separate inputs that needs to be driven. On IR LED side, I connected all 3 LED's to one small signal MOSFET that will drive the Cathode of the LED Low when Ir signal is send from the Flyport. Swiching on/off the signal helps to save some battery when the sensor is not used. On the IR Receiver side, I used a nice trick with a capacitor (100nF) in parallel to the transistor. In a first step, we charge the capacitor, turn the Flyport line into intput and wait until the line goes low. This allows to mesure the sensor without ADC converter. In order to run a counter without stopping the robot, a timer interrupt is used, storing the counter value when the distance is mesured. The IR sensor code is stored in the External Library folder under IR_Sensor.c. It provides both IR distance and ambiant distance.
The code to stop the robot at table borders and to avoid obstacles is not yet finished, levaing you with some challanges to add some code. A first draft is included in taskflyport, but it is disables as it does not work yet.
Two 800mA cells are perfectly fine.
To connect to your Zrobot, you will need to change the network setup of your PC/Iphone and select the Zrobot SSID. Next open a web browser, this one may automatically open a window with the web-interface, if not, enter the Zrobot/Flyport IP address 192.168.1.115. The web inteface will be downloaded from the Robot to the browser.