Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 23rd March 2007, 01:15 PM   (permalink)
Default SRF04 + Bargraph

First - I am very, very new to PICs and don't feel confident to develop this project all on my own. Hence this request to you amazingly clever and innovative people!

I work in the heavy transport industry. Reversing a 13 metre trailer up to a loading dock is more often than not done by touch! Trailers and loading deck get damaged.

I want to develop a simple parking sonar device, using a pair of transducer modules (one on each side of the trailer rear to take care of non-parallel approach) and a bargraph showing the distance from each module to the loading dock.

I thought of using a pair of SRF04 modules, a PIC and two bargraph displays.

Once I had come up with the concept, I realised I haven't the faintest idea of how to implement the idea.

Can anyone help?
Thanks
Azaruk is offline  
Old 23rd March 2007, 01:48 PM   (permalink)
Default

Details of a similar product, using different transducers and discrete logic in place of a microcontroller and audio feedback in place of a bargraph, can be seen here - including a circuit diagram.

http://www.velleman.be/be/en/product/view/?id=9147
DeeJay is offline  
Old 23rd March 2007, 02:03 PM   (permalink)
Default

I'd recommend downloading Proton Lite, and having a read through the help file and Protons Forums, this would be a very easy program to create with PIC Basic.

http://www.picbasic.org/proton_lite.php

This device would also be very easy to interface with, and it offers quite a lot of features;



* 0 - 255 inches range with 1 inch resolution
* 42kHz Ultrasonic sensor
* New LV version operates from 2.5-5.5V
* Low 2mA supply current
* 20Hz reading rate
* RS232 Serial Output - 9600bps
* Analog Output - 10mV/inch
* PWM Output - 147uS/inch
* Small, light weight module

To read how far away the object is would be as simple as;

Video: http://www.box.net/shared/q6mhhh4bu8

Code:
Device = 16F877
XTAL = 4
 
Dim Distance as Float

DECLARE ADIN_RES 10 		' 10-bit result required 
DECLARE ADIN_TAD FRC 		' RC OSC chosen 
DECLARE ADIN_STIME 50 		' Allow 50us sample time

LCD_DTPIN = PORTB.4
LCD_RSPIN = PORTB.2
LCD_ENPIN = PORTB.3
LCD_INTERFACE = 4
LCD_LINES = 2
LCD_TYPE = 0

ADCON1 = %10000000 			' Set analogue input, Vref is Vdd
Input PORTA.0
Input PORTA.1

DelaymS 100
Cls

Main:

        Distance = ADIN 0                           ' Grab the digital value of PORTA.0
        
        Distance = Distance * 5 / 1023          ' Convert to volts
        
        Distance = Distance / 0.010               ' Find out how many 10mV go into it
        
        Print At 1, 1, "D1 = ", Dec1 Distance, 34, "  "
		
        Distance = ADIN 1                            ' Grab the digital value of PORTA.1
        
        Distance = Distance * 5 / 1023             ' Convert to volts
        
        Distance = Distance / 0.010                 ' Find out how many 10mV go into it
				
        Print At 2, 1, "D2 = ", Dec1 Distance, 34, "  "
        
        Goto Main
For more information on any command, simply have a look at the Proton help file for that command
__________________
Spency.

PIC Micro's - Your mind is the limit

PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net
gramo is online now  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
PIXAXE-18 and the SRF04 fishyghost Robotics Chat 10 20th June 2006 02:28 PM
LED Bargraph thermometer opinion... William At MyBlueRoom General Electronics Chat 2 24th May 2006 11:02 PM
Purchasing SRF04 in Canada micro571 General Electronics Chat 2 3rd April 2006 06:49 AM
srf04 ultrasonic sensors cjgalway1000 Robotics Chat 2 5th March 2004 05:55 PM
Bargraph oil pressure reader using LM3914 ekooke Electronic Projects Design/Ideas/Reviews 1 22nd December 2003 10:59 AM



All times are GMT. The time now is 07:50 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker