How to design a Passive Infrared (PIR) Open Source ProjectIonela
This article details the hardware and software required for a fully functional passive infrared (PIR) sensor with an associated remote control unit. The remote control unit adjusts key algorithm detection parameters which are stored in the MC68HC908JK1/3 FLASH memory area.
How to design a Passive Infrared (PIR) Open Source ProjectIonela
This article details the hardware and software required for a fully functional passive infrared (PIR) sensor with an associated remote control unit. The remote control unit adjusts key algorithm detection parameters which are stored in the MC68HC908JK1/3 FLASH memory area.
Edgefxkits.com has a wide range of electronic projects ideas that are primarily helpful for ECE, EEE and EIE students and the ideas can be applied for real life purposes as well.
http://www.edgefxkits.com/
Visit our page to get more ideas on popular electronic projects developed by professionals.
Edgefx provides free verified electronic projects kits around the world with abstracts, circuit diagrams, and free electronic software. We provide guidance manual for Do It Yourself Kits (DIY) with the modules at best price along with free shipping.
This is a robot car that can be remotely controlled using a Bluetooth terminal mobile application and has the capability to avoid the collision with the obstacles.
Básicos de Functional Test Systems - Testing Days TijuanaInterlatin
Conoce las características principales de los sistemas TS-5400 de Keysight Technologies y aprende a seleccionar la configuración de sistema adecuado a tu producto.
Muchos ingenieros de prueba electrónica están muy acostumbrados a trabajar con la interfaz de UNIX y se niegan a cambiar a Windows, basados en rumores y/o falta de información. En este entrenamiento, encontrarán lo fácil que es hacer la migración entre Unix y Windows y todas las ventajas que tiene utilizar Windows en los equipos ICT de Keysight Technologies
You will know how to use the LTE 4G FDD GPS tracker TK419
TK419 is often used to track vehicles, motorcycles or boats,and It is a useful tool for fleet management. The users can also cut off fuel/ignition remotely and check historical routes and other vehicle data. The TK419 has excellent stability.
TK419 can be used for locating, tracking and monitoring any remote target through SMS, PC Computer or Mobile APP.
like our page for more updates:
https://www.facebook.com/Technogroovyindia
With Best Regard's
Technogroovy Systems India Pvt. Ltd.
www.technogroovy.com
Call- +91-9582888121
Whatsapp- +91-8800718323
PowerMate15 is a digital switching solution developed for the transportation market. It provides in one package state of the art digital switching technology and easy to understand user interface for designers with an extensive and sophisticated menu of switching solutions.
Arduino Interface LM35 MQTT Using UARTSanjay Kumar
Here we are implementing a Master-Slave Communication between two Arduino Uno Board with HC-05(Bluetooth) and Sending orreceiving data to and from an MQTT Client.
Multi-Function Automatic Move Smart Car for ArduinoWanita Long
ICStation team share this open source of making Multi-Function automatic move smart car with all electronic DIY hobbyists.It is the third car we introduce to you and you can make a comparison with the two previous. The multi-Function automatic move smart car uses an MCU development application system and a 4-wheel driver system,the core of which is arduino Atmega-328P.It can realize multifunction,such as tracking,obstacle avoidance,remote control and some other functions.
Edgefxkits.com has a wide range of electronic projects ideas that are primarily helpful for ECE, EEE and EIE students and the ideas can be applied for real life purposes as well.
http://www.edgefxkits.com/
Visit our page to get more ideas on popular electronic projects developed by professionals.
Edgefx provides free verified electronic projects kits around the world with abstracts, circuit diagrams, and free electronic software. We provide guidance manual for Do It Yourself Kits (DIY) with the modules at best price along with free shipping.
This is a robot car that can be remotely controlled using a Bluetooth terminal mobile application and has the capability to avoid the collision with the obstacles.
Básicos de Functional Test Systems - Testing Days TijuanaInterlatin
Conoce las características principales de los sistemas TS-5400 de Keysight Technologies y aprende a seleccionar la configuración de sistema adecuado a tu producto.
Muchos ingenieros de prueba electrónica están muy acostumbrados a trabajar con la interfaz de UNIX y se niegan a cambiar a Windows, basados en rumores y/o falta de información. En este entrenamiento, encontrarán lo fácil que es hacer la migración entre Unix y Windows y todas las ventajas que tiene utilizar Windows en los equipos ICT de Keysight Technologies
You will know how to use the LTE 4G FDD GPS tracker TK419
TK419 is often used to track vehicles, motorcycles or boats,and It is a useful tool for fleet management. The users can also cut off fuel/ignition remotely and check historical routes and other vehicle data. The TK419 has excellent stability.
TK419 can be used for locating, tracking and monitoring any remote target through SMS, PC Computer or Mobile APP.
like our page for more updates:
https://www.facebook.com/Technogroovyindia
With Best Regard's
Technogroovy Systems India Pvt. Ltd.
www.technogroovy.com
Call- +91-9582888121
Whatsapp- +91-8800718323
PowerMate15 is a digital switching solution developed for the transportation market. It provides in one package state of the art digital switching technology and easy to understand user interface for designers with an extensive and sophisticated menu of switching solutions.
Arduino Interface LM35 MQTT Using UARTSanjay Kumar
Here we are implementing a Master-Slave Communication between two Arduino Uno Board with HC-05(Bluetooth) and Sending orreceiving data to and from an MQTT Client.
Multi-Function Automatic Move Smart Car for ArduinoWanita Long
ICStation team share this open source of making Multi-Function automatic move smart car with all electronic DIY hobbyists.It is the third car we introduce to you and you can make a comparison with the two previous. The multi-Function automatic move smart car uses an MCU development application system and a 4-wheel driver system,the core of which is arduino Atmega-328P.It can realize multifunction,such as tracking,obstacle avoidance,remote control and some other functions.
This paper focuses on the materials, working principle of a robotic vehicle which will be controlled with hand motion. The aim of this research is to enhance industrialization by creating a hand motion controlled robotic vehicle, since it uses hand motion it will be easier to use in automation and various industries. It is also very beneficial for people with disabilities since only hand motion is required. There were various materials that were used in the research. 2 microcontrollers, an accelerometer, RF modules, encoder, decoder, diode, motor driver IC, DC motor and batteries. The microcontrollers are small computers which can be programmed to be utilized in various different ways. The Accelerometer is a PCB or a sensor which detects speed. The RF modules are of two types which are transmitters and receivers and they are components which are used to send data and information wirelessly. The encoder and decoder are used to convert the binary to any n number of output terminals. The diode is used to send the electricity in one direction. The motor driver IC controls the DC motor from the information given by the microcontroller ICs and lastly a 9v Battery will be used to power the system. The arduino software will be used to program the IC so it can perform the required task. The gadget features a receiver circuit that is intended to be worn on top of the user's glove. The vehicle's circuit incorporates an RF receiver, an 8051 CPU, and a Driver IC to power the motors. This method is extremely useful for persons with impairments since it allows a robotic vehicle to drive itself using hand gestures. The person only needs to move his hand to move the car forward, backward, left, or right. As a result, the user is not required to push any buttons.
2. i
This document is to provide fundamental information in regards to the
DeVry University course ECET 365 Embedded Microprocessors Systems w/
Lab. During the course of this document each section and stage of
development will be discussed to include an overview, identification of
systems and subsystems, testing, and the basic operation of the robot.
3. Contents
Overview.....................................................................................................................................................1
Project Requirements ..................................................................................................................................1
Projected Project Cost for Materials:..................................................................................................1
Projected Project Cost for Alternative Materials:...............................................................................2
Power Supply and Filter..............................................................................................................................2
Visual Sensors and Modules.......................................................................................................................3
Motors .........................................................................................................................................................4
Potential Wireless Enhancements ...............................................................................................................5
Basic Operation of Robotic Car..................................................................................................................6
Testing Plans...............................................................................................................................................8
Motor Testing........................................................................................................................................8
IR Proximity Sensor Testing...............................................................................................................9
Visual Subsystem Testing...................................................................................................................9
Steering Subsystem Testing.............................................................................................................10
Power Supply Testing........................................................................................................................10
Current Draw Testing.........................................................................................................................10
Visual sensor and steering operation interaction ..........................................................................12
Drive Motor Subsystem.....................................................................................................................13
System Operation Testing ................................................................................................................13
Appendix A – Data Sheets....................................................................................................................14
Source Code ...........................................................................................................................................15
4. 1
ECET 365 Robot Car Project
Overview
The robot car, when completed will follow a 1” wide centerline track in the shape of an oval. The
track may be composed of a foam board using black tape as the track line or centerline. The overall
objective of this project is to build a robot that contains subsystems to a main system which will enable
it to follow the black line for a minimum of two laps on the provided track. The subsystems are power
supply, steering, motor controls, and visual sensors. The manual will provide data for each subsystem,
parameters, diagrams, and testing methods and results.
Project Requirements
The project requirements are in two parts, the hardware, and software or code. The general list of
materials are as follows:
Identify Physical Requirements
Identify Modular Groups to create/assemble end
goal
Identify Required Code for each subsystem
Clock
I/O
Counters (if needed)
Comparators (if needed)
Identify possible alternative motors
Datasheets
Identify possible alternative sensors
Datasheets
Identify alternative microcontrollers
Datasheets
Projected Project Cost for Materials:
Item Part
Number
Cost
ROBOTIC CAR KIT
Kit includes:
PmodHB5 – H-Bridge Module
PmodLS1 Infrared Light Detector Modules
909-MOD-LTR501ALS
Long Range Sharp GP2Y0A02YK0F
Support Frame
Wheels (2)
240059 $168.37
DeVry Tower Kit twredukit $376.64
5. 2
Projected Project Cost for Alternative Materials:
Alternative Replaces Function Cost
ARM STM32 Cortex-
M4
STM32F4DISCOVERY
TWR-S12G128
Board
Microcontroller 140.99
L298 Dual H-Bridge
DC Motor Controller
PmodHB5 H-Bridge Module 7.56
909-MOD-LTR501ALS PmodLS1: Infrared
Light Detector
Visual Sensor
Module
18.44
Infrared Proximity
Sensor Long Range -
Sharp GP2Y0A02YK0F
Digilent IR Proximity
Sensors
Visual Sensor 14.59
Required software is CodeWarrior IDE. This is a product of Freescale, now part of NXP (NXP.com,
2016). IDE allows the user to program in C which the Pulse Width Modulator, set the Duty Cycle to
adjust the speed of the robot, and to enhance its function at a later date.
Power Supply and Filter
The robot requires at a minimum of +5.5V DC to operate both the tower which contains the
microcontroller and the two DC motors that propel the robot. The power is supplied by four NiMH
rechargeable AA batteries that provide 1500mAh each with an average DC output of +5.5V. And eight
NiMH rechargeable AA batteries with an average output of +11.5V for the DC motors. By separating
the two systems and dedicating each its own power supply, it will ensure a longer lifecycle for the robot
between charges. The power for the tower and microcontroller is fed through a DC power filter to
remove and potential spikes or any noise that may damage the microcontroller.
The filter consists of two 1000uF capacitors, two 0.1uF capacitors, and one 100mH inductor and
assembled in accordance with the below schematic.
Figure 1 Power Supply Filter 1
6. 3
Visual Sensors and Modules
The visual sensors are Digilent IR proximity sensors that have both an IR transmitter and IR
receiver built in. The kit is equipped with four sensors however the project only requires two to function.
In addition to the IR Proximity sensors, the IR Detector module directs the signal to the microcontroller.
The visual sensors require a +3.3V DC to operate which is delivered by the microcontroller via the
sensor module.
Figure 2-a IR Sensor Placement 1
Figure 2-b 1
7. 4
Motors
The motors that are used in this project are model IG220019X00015R. They are a 12V DC
motor. The turn both clockwise and counter clockwise. The project requires two motors, located in the
front of the robot to “pull” the robot forward. The rear of the robot is supported by a large plastic post
place centerline on the back of the robot.
When the motors were received, they were tested for functionality. They were tested by applying
5V DC to the positive (Red) and ground to the negative (Black) wires. The direction of spin was
annotated. Next the leads were reversed, by placing the 5V DC to the negative (Black) wires and ground
to the positive (Red). This proved that the motor rotated in the opposite direction. This result was also
recorded. Next a 12V DC power supply was applied to each motor to test the maximum rating to ensure
that each motor rotated in both directions at maximum DC voltage.
Figure 3-a: Motor Specs 1
Figure 3-b Mounted Motors 1
8. 5
Potential Wireless Enhancements
The microcontroller has the potential to expand with a wireless capability. The microcontroller
has the ability to use both Bluetooth and Wi-Fi for adding additional peripherals that can communicate
and be controlled by the microcontroller. By using the Wi-Fi option the user may be able to control the
robotic car directly by sending direction to the car. The car can also be equipped with a recording deice
that can send data to a central location via Wi-Fi or Bluetooth for review at a later time. Some of these
modules are listed below:
Bluetooth Table 1 1
Comparison
Item
XBee 802.15.4 Digi-Key RN4020-V/RM-
ND
TDK
SESUB-PAN-T2541
Data Rate 250kbps 1Mbps 250kbps, 500kbps,
1Mbps, 2Mbps
Security 128-bit AES AES 128 Encryption AES-128 w/ CTR, CCM,
CBC-MAC modes
Interference DSSS(Direct Sequence
Spread Spectrum
Simple, UART UART/SPI/I2C/GPIO/A
DC2.4GHz Bluetooth
Wi-Fi; Internet; 802.11 b/g/n Table 2 1
Comparison
Item
ESP-WROOM-02 WiFi
802.11 Module
Tiny UART Embedded
WiFi Module - HF-
LPT100
Embedded WiFi Module
- 802.11 b/g/n Industrial
Temperature HF-A11
Data Rate 1Mbps,6Mbps,
6Mbps,11Mbps,
54Mbps,65Mbps,
72.2Mbps
802.11b: -93 dBm (@
11Mbps)
802.11g: -85 dBm (@
54Mbps)
802.11n: -82 dBm (@
HT20, MCS7)
UART: 230,000 bps max
Ethernet: 10/100Mbps
Security WPA/WPA2
WEP/TKIP/AES
Encryption
WEP/WAP-PSK/WAP2-
PSK
WEP/WAP-PSK/WAP2-
PSK/API
WEP64/WEP128/TKIP/A
ES Encryption
Interference 802.11 b/g/n
TCP/UDP/HTTP/FTP
TCP/IP/UDP/FTP/HTTP
Networking Protocols
802.11 b/n/g
UART
10/100 Ethernet
GPIO (up to 7, mode
dependant)
9. 6
Basic Operation of Robotic Car
The robotic car in its base configuration is designed to run on a track with an
approximately one inch thick centerline. This track is to be in the shape of an oval or large
circle (all system tests were conducted on a circular track). Once the robot is placed on the
track there are four power switches that need to be switched to the power on position. The first
switch is located in the rear of the tower on the lower right corner (Figure 5-a).
Figure 4-a 1
Tower Power Switch
10. 7
The additional power switched are located on the chassis, one on each side for each
motor and one in the rear for the tower (Figure 5-b).
Figure 4-b 1
Once all power switches are in the on position the robot will start moving along the black
centerline drawn in the oval or circular form. To stop the robotic car left it from the track and
switch the rear power switch to the off positon.
Left Motor Power Switch
Tower Power Switch
Right Motor Power Switch
11. 8
Testing Plans
Motor Testing
Use Ohmmeter to measure resistance for DC motor used in this Lab.
Resistance was measured by placing the DMM leads on the Red and Black wire pins
connected to the motor wiring harness. Ensuring that the DMM was in the proper mode
to measure resistance and all power was disconnected from the motor, the reading was
5.9 Ω
Explanation of how you turned the DC motor “on” and “off.”
The microcontroller is loaded with the code that has a 75% duty cycle. The
microcontroller outputs the signal to the H-bridge, which in turn saturates or turns ‘On”
the motor during the positive portion of the wave (75% Duty Cycle or Pulse Width)
which provides enough average voltage to turn the motor.
How to choose the speed of DC motor.
To choose the speed of the DC motor, the duty cycle is adjusted. The longer the pulse
width the higher the voltage, the faster the rotation of the motor.
Definition of load and no-load RPM in DC motor.
The load is when friction is applied or resistance applied to the motor when activated.
The no-load is when there is no resistance applied to the motor shaft.
Connect a DC motor leads to +5V and Ground and measure the current usage on current meter.
Examine loaded and no-load current usage. Give your conclusion.
No-Load Current: 128mA @ 10VDC
w / Load Current: 153mA @ 10VDC
Why use the PWM technique.
Using the Pulse Width Modulation (PWM) technique, we can achieve analog results with
digital means. The pulse provides short burst or pulses of DC voltage and when adjusted
to a frequency faster than the human eye can see, a light would appear to be on even
though it is blinking or pulsing.
12. 9
IR Proximity Sensor Testing
The change in the output of the visual sensors as the striped index card is moved from the center
to each side of the center line.
The change in output from the visual sensors went from a low to high DC change in
voltage. When the dark area on the card was under the sensors the LEDs on the module
were ‘On’ and when the card was moved so that only the white was below the sensors the
LEDs were ‘Off’. The attached video also captures the O-Scope reading.
Describe the effect of the potentiometer on the output of the sensor module.
The potentiometer of the sensor module is used to adjust the sensitivity of the sensors. By
adjusting the pot value to an optimum value or threshold the sensors were able to detect
and acknowledge the change in density (light and dark) of the card.
If the motors and software are installed, describe the action of the drive wheels as the index card
is moved left and right.
As the card is moved from right to left, the motors would change their velocity to turn the
robot so that it will follow the dark line on the card.
Visual Subsystem Testing
Test Method: (Briefly describe the test method used to verify the correct operation of the visual
subsystem.)
Method used to test the visual system: Visual sensors were connected to the visual
control module which was connected to the 9S12 microcontroller. A voltage of +3.3 V
was applied to the Vcc pin of the module. With the sensors power applied and sensors
enabled a card with a 2” x 2” black square was moved below the sensors.
Test Results: (Record the measurements that indicate the visual subsystem is operating
correctly).
The measurement was taken using an oscilloscope which allowed for a graphical reading
of voltage change. As the card was moved under each sensor, a voltage change occurred.
When the card was removed from beneath the sensor, the voltage would change again
going from High to Low and Low to High. Also when the voltage would change, the
LEDs on the visual sensor module would light indicating that there was a change in the
output of the sensors.
13. 10
Steering Subsystem Testing
Test Method: (Briefly describe the test method used to verify the correct operation of the steering
subsystem.)
The steering system was tested by connecting the motors to the H-Bridge modules. The
Right motor to the Right H-Bridge module and the Left motor to the Left H-Bridge
module. A +3.3V DC was connected to the DIR pin of the H-Bridge modules. An
oscilloscope was connected to the Enable pin to ensure that a control voltage is received
from the tower.
Test Results: (Record the measurements that indicate the steering subsystem is operating
correctly.)
The results were that each module received a +0 to +3.3V DC(2.3V DC) voltage was
applied to the enable pin of the H-Bridge module. Both modules, Right and Left received
the voltage
Power Supply Testing
The power supply filter, once assembled was tested by applying +5.5V DC to the input of the
circuit. Once connected, using a DMM, the negative lead of the meter is connected to the
negative side of the circuit which is connected to the negative side of the power source (four AA
batteries). The positive lead is then used to step across from the input of the board to the lead of
the first capacitor (1000uF), then to the capacitor (0.1uF), the input of the 100mH inductor, then
to the second 0.1uF capacitor, to the lead of the second 1000uF capacitor. The lead of the second
1000uF capacitor is the output of the filter circuit.
Secondly, the filter circuit is connected to an oscilloscope to monitor the input voltage verifying
that there is zero noise or power spikes that could damage the microcontroller.
Current Draw Testing
For each subsystem, determine the actual current draw. If a sensitive ammeter is not available,
use a small (0.1 or 1 ohm) resistor in series with the power lead. Measure the voltage across the
resistor and calculate the current using Ohm’s Law (I = V/R).
Visual sensor 0.5mA The measurement was taken by measuring the current draw for the
tower with the Visual sensors connected (21.7mA), then again without the sensors not
connected (21.2mA). The difference was taken which is 0.5mA.
14. 11
Tower/CPU 21.2mA This was taken with all modules and peripherals disconnected.
Right Motor 117mA / 115mA See below for details
Left Motor 124mA / 126mA See below for details
*The motor values were measured using two methods to compare for accuracy as they
will be the largest current consumption parts of the robot. The first method was by
connecting an ammeter between the power supply and each motor. By doing so, the
circuit is completed and the amps are measured as the amps are pulled from the power
supply.
The second method was by taking a 1Ohm resister and placing is in series with the motor
circuit and the power supply. Once connected and circuit was completed the voltage
across the resister was taken and recorded then used to calculate the current using Ohm’s
Law I=V/R yielding the second set of results above for the Right and Left motors.
There is a slight difference so for the future calculations the higher value will be used as
the minimum current draw required to ensure that there will be sufficient current
available for the project.
Calculate the expected operating time for the system. Ensure that the motor power operating
lifetime will not exceed the CPU board operating lifetime.
In calculating the Motor System Lifetime and CPU Board Lifetime, the following
calculations were used:
For the motor current, the higher of the two values, 126mA was used for calculations.
The formula Amps * Duty Cycle (minimum of 60%) will yield the required amps needed
for one motor. By doubling this value will will yield the minimum current draw required
for the 2 motors. This should also provide additional available current if needed. If the
NiMH battery is used a single AA provides 1500mAh of current. By dividing 1500mAh
by 252mA the Motor System Lifetime value should be 5.95h.
*Even though the above calculations have been completed with the values of a single AA
each power source will be comprised of a minimum of four AA batteries to produce a 6V
DC which will be provided to the DC motors which are rated to 12V DC.
Motor System Lifetime 5.95h
Calculating the CPU Board Lifetime is a little less complicated as there will not be a
Duty Cycle to use in the calculations. The direct current draw of the CPU or in this case
the Tower to include the visual sensor modules and H-Bridge modules is 21.9 mA. Using
15. 12
the same battery type and values of 1500mAh and dividing by the 21.9mAh the
CPU/Tower Lifetime should be 68.49h.
*Even though the above calculations have been completed with the values of a single AA
each power source will be comprised of a minimum of four AA batteries to produce a 6V
DC which will be provided to an 7805 voltage regulator which will provide +5V to the
power filter which will then provide power to the tower.
CPU Board Lifetime 68.49h.
Visual sensor and steering operation interaction
Test Method: (Briefly describe the test method used to verify that the visual sensor subsystem
and the steering subsystem are working correctly together.)
The sensor and steering system tested together was accomplished by connecting the
motor subsystem and the visual subsystems to the 9S12 microcontroller tower. The tower
provides a PWM and a Duty Cycle of 60% as recommended by the construction notes.
The H-Bridge modules are connected to the tower which supplies the +3.3V DC Vcc and
+0 to +3.3V DC enable voltage. A +5V DC is connected to J3 of the H-Bridge module to
supply the motor with a drive current to turn the motors.
Test Results: (Record the measurements that indicate the visual sensor and steering subsystems
are working correctly together.)
With the robot inverted so that the sensors are facing upward and the wheels are upward a
card with a 2” x 2” black square is passed over the sensors. As the square moves over
each sensor, the corresponding H-Bridge receives a voltage on the Enable pin. When the
black square is over both sensors, both H-Bridge modules receive the enable voltage from
the tower at the same time which would turn the motors if they were connected. Each
motor turned in the correct direction due to having the DIR pins of the H-Bridge modules
connected to the +3.3V DC and Ground respectively.
16. 13
Drive Motor Subsystem
Test Method: (Briefly describe the test method used to verify that the drive motor subsystem is
working correctly.)
To test the drive motor subsystem each motor was connected to +5V DC to J3 on the H-
Bridge modules to drive the motors. Then a +3.3V DC was applied to the enable pin of
the H-Bridge module to enable the motor(s). Then Ground was connected to the DIR pin
of the H-Bridge module to test each motor for a reverse direction.
Test Results: (Record the measurements that indicate the drive motor subsystem is operating
correctly).
When the +3.3V DC was applied to the enable pin of the H-Bridge module the motor
would engage. The speed of the motor depended on the Duty cycle provided by the
tower. This value can be adjusted by editing the source code for the tower. Currently it is
set at 60%. Each motor turned in both directions. This was tested by connecting both
+3.3V DC and Ground to the DIR pin of the H-Bridge module and testing each
separately.
System Operation Testing
Test Method: (Briefly describe the test method used to verify that the system operates correctly
when all the subsystems are operating.)
The visual sensors are mounted to the frame and connected to the tower via the sensor
module. The H-Bridge modules are connected to the motors and to the tower. The tower
provides a PWM and a Duty Cycle of 60% as recommended by the construction notes.
The motors and the H-Bridge modules are connected to the tower which supplies the
+3.3V DC Vcc and +0 to +3.3V DC enable voltage. The H-Bridge modules will have
+5V DC and +12V DC tested. The motors are +12V DC motors.
This test will be conducted in two stages; first stage is with the robot inverted so that the
wheels have zero load; second with the robot upright so that it can run along the track
line.
Test Results: (Record the measurements that indicate the system is operating correctly.)
The robot during first test (+5V DC for motors) seems sluggish. Will recharge batteries to
ensure test is with full charge. Second test run robot seems to operate properly. The speed
of the robot will be adjusted so that it can maintain a maximum life cycle in regards to the
power supply of both the tower and the motors.
Robot with fully charged batteries performed on target. Microcontroller was re-flashed
with a lower duty cycle to slow the speed which brings the robot to a more controllable
speed in regards to the given track that is must follow. At 60% duty cycle the robot would
not be able to correct its line of travel and would travel off the track and come to a stop.
17. 14
Appendix A – Data Sheets
Motor Datasheet.pdf
H-Bridge Datasheet.pdf
Visual Sensor Module Data Sheet.pdf
TSL1401 Video Sensor Datasheet.pdf
MC9S12G Microcontroller Overview.pdf
18. 15
Source Code
#include <hidef.h>
#include <math.h>
#include "derivative.h"
byte sensor;
void main(void) {
// Set variables for the Pulse Width Modulation (PWM) Signal.
PWMCLK = 0x03;
PWMSCLA = 2;
PWMPOL = 0x03;
PWMPER0 = 200;
PWMPER1 = 200;
PWMDTY0 = 145;
PWMDTY1 = 145;
CPMUCOP_CR = 0; // disable COP
DDRA=0x00;
for(;;)
{
sensor = PORTA & 0x03;
switch(sensor)
{
case 0: // Both sensors are off.
PWME = 0x03; // Turn both motors on.
break;
19. 16
case 1: // Right sensor is on.
PWME = 0x01; // Turn right motor on, left motor off.
break;
case 2: // Left sensor is on.
PWME = 0x02; //Turn left motor on, right motor off.
break;
case 3: //Both sensors are on.
PWME = 0x00; // Turn both motors off.
break;
}
}
} /* loop forever */
/* make sure that you never leave main */