Start here robot ultrasonic sensor

sensor.jpg (27909Bytes)
2_0.JPG (1396355Bytes)
(Bytes)
3_1.JPG (1266171Bytes)

Newbie here

Hi every one i have been member for a while now and have finally collected all the parts needed to complete fritz start here robot.

Every thing is the same apart from im using a 28x2 picaxe instead of the 28x1 picaxe,also using the ultrasonic sensor pictured below (in attachments instead of the SRF05.

i have followed the walk  through on https://www.robotshop.com/letsmakerobots/node/66  for the SRF05 sensor and translated the wires to my sensor as followed:

wire             srf05                mine

black           ground 0v         gnd

blue             trigger input      trigger

yellow          echo output      echo

red               5v supply          vcc

i also used the basic program from   https://www.robotshop.com/letsmakerobots/node/66 and nothin happens????????

here is the spec for the sensor:

Description:

  • The modules includes ultrasonic transmitters, receiver and control circuit
  • Its stable performance and high ranging accuracy make it a popular module in electronic market
  • There are 5 pins out of the module, VCC, Trig, Echo, GND and OUT
  • Best performance in 30 degrees angle
  • Electronic brick compatible interface
  • Dual transducer
  • Arduino library ready

Specifications:

  • Voltage: DC 5V
  • Current: 15mA
  • Ultrasonic Frequency: 40K Hz
  • Maximal Range: 400cm / 13 feet
  • Minimal Range: 3cm
  • Resolution: 1cm
  • Trigger Pulse Width: 10μs
  • Dimension (L x W x H): Approx. 44 x 20 x 18 mm

i am hoping some one can point me in the right direction.

link to seller as requested

http://cgi.ebay.com/Ultrasonic-Sensor-Distance-Measuring-Module-DC-5V-15mA-/120716643400?pt=AU_B_I_Electrical_Test_Equipment&hash=item1c1b45cc48

We need:

A part number for that sensor --I/we need a data sheet so we can figure out what that extra “out” pin is and what it does. A CLEAR IN FOCUS picture of your wiring would help a lot too.

hi chris the carpenter,

thanks for the fast reply.

i had no data sheet for it ,so just emailed the supplier for one,and asap i will post picture of the wiring set up.

one again thank you for quick responce

 

Who makes your sensor? Where

Who makes your sensor? Where did you get it? If it was somewhere online could we have the linky?

And you refer to a picture above. There is no picture, just FYI.

hi jax

i have added link to where i bout the sensor,

the picture is in the attachment file

many thanks

The SHR setup should work.

The SHR setup should work. Your sensor is an SRF04-type clone. Perhaps it is something with the hardware. Any pics of your setup available?

hi jax

jax i have added three pictures to the attachments(not bad quality)

hope this helps

cheers

Looks right…

First off, I dunno 'bout this “out” pin. Man, I would like to see a data sheet. Skip it for now, I guess.

One thing I did see is maybe your connector. It appears to be a 2x5 or 2x6 ribbon connector. Is this correct? If so, you need to do some double checking on your pin-outs. If indeed it is what I think it is, you have 2 rows of holes and are using one row to connect to the sensor. When looking at the top of the connector (where the ribbon cable would go) you would be connecting to every-other pin. Even numbered connectors will be one row and odd will be the other.

Easiest way to check here would to do a simple continuity test to be sure you are connected to the correct pins.

Yes, that is a curious

Yes, that is a curious connector to use. Looks like a leftover 10-pin ISP plug. Other than that it looks fine. So you say nothing happens. Does the debug window pop on your monitor or is there truly nothing at all?

good morning everyone

i have now replace the connector that jax and chris have both noticed,with female to female conectors

jax this is the program from the fritz walk through iv been using,when run i get the debug window start up an i get slight twitch on the servo. after this nothing but the debuy counting upwards, in the very right hand conner next to the debug word.???

could the problem be ccaused as im using a 28x2 picaxe  in stead of the 28x1 ?? as i have noticed on there data sheets that they have different pin name  (please bare in mine if this is stupid comment i am very new to all this lol)

symbol trig = 3 ‘ Define output pin for Trigger pulse
symbol echo = 6 ‘ Define input pin for Echo pulse
symbol range = w1 ‘ 16 bit word variable for range

main:
pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10 ‘ recharge period after ranging completes
‘ now convert range to cm (divide by 5.8) or inches (divide by 14.8)
‘ as picaxe cannot use 5.8, multiply by 10 then divide by 58 instead
let range = range * 10 / 58 ‘ multiply by 10 then divide by 58
debug range ‘ display range via debug command
goto main ‘ and around forever

x2’s

Don’t quote me on this but I think you need to define what port you are using. If you look at the pinout of the x2’s, you will notice that the pins are numbered but each “bank” of pins gets a letter too. Check the pinouts, check the lables, you may need to add these letters to your code.

Instead of trig = 3 it might be trig = B.3 or C.3

Instead of echo = 6 it might be echo = B.6 or C.6

Note that we are using a decimal here. These are NOT B1 as in byte-one, it is B-point-one, which declares a pin.

 

I have no idea if this is going to make a difference --It is worth a shot though.

hi chris the carpenter,

hi chris,

as you stated i changed trig to B.3 echo to C.6

now in the debug window  i get readings in the b2 on the left hand side an  readings in the w1 boxs on the right hand side which both go up an down when i move hand infront of the sensor?

would this be correct chris 

 

Yes.

Yes indeed. It seems to be working.

b2 and w1…

In terms of robot brains and code and computers and the like, you got yourself some bytes. A byte is made up of 8 bits, each of which can be either on or off. With these 8 bits, the maximum number of combinations you can make is 256. Therefore, a byte can contain (be) a number between 0 and 255. In the picaxe world, bytes are b0, b1, b2 etc. —Now, if you need a bigger number, you can move up to a word. A word is made up of (2) bytes and thus, 16 bits. Same rule applies --the number that the word contains (is) can be as large as the number of different combinations that you can make with the bits. It works out to 0-65,535.

To cut to the chase, W0 or “word variable, number zero” is made from b0 and b1 (“byte variable, number zero and byte variable number one”).  When you are looking at your debug window, ALL of the picaxe variables are being shown. You can see both the word variable --where you are storing the sonar range, but ALSO you can see the 2 byte variables that that word is “made” from.

With what you are doing now, I would pay no attention to the byte values shown in the debug window --do however, note their existance --in the future you will need to learn how to work with them.

 

One more thing to note is where the “debug” command is within your code. If the debug is after the pulsin but BEFORE the *10/58 stuff, the debug window will show the raw range data. If the “debug” command comes AFTER the *10/58 stuff, you will see the range after its conversion --the debug window will show your range in inches or CM or whatever you are converting to. --This is assuming that your aftermarket sonar sensor is spitting out numbers that are close to the SRF05’s numbers. I would assume they are pretty close but do some testing with the debug window, a book or something for a “target” and a tape-measure.


Did I confuse you at all?

 

I should add

All the numbers I quoted above --the 0-255 thing and the 0-65,535 thing. These numbers pertain to the picaxe. Other chips allow for even bigger numbers, numbers with decimals and negitive numbers --some/all of these things can affect the “range” of values you can work with.

Looks like JAX and CtC have

Looks like JAX and CtC have got you steered towards a solution on your sensor.

I have a question for you on another topic. I see your robot has four motors. The Picaxe board can drive two motors. How are you connecting your motors?

hi ignoblegnome

 i had noticed that all the start here robots have only 2 motors  conected to the A and B ports, and i noticed that theres not enough ports for more motors.

so i connected them in series, so two motors run to gether of the A port (Right side of robot) and 2 run together of the B port (Left side of robot)  when turning to miss objects it turns nicely on the spot even on carpet an in garden on gravel.

have had no problems with this set up,but as you all know i am new to all thiswould this cause any problems with the picaxe or with the power used? 

Motors used are 200:1 geared

Ohm and his damn laws…

I think you may have made some homework for yourself --and this is a good thing.

I am not going to answer the question here, but I will point you in the right direction.

The questions is, “Should my motors be in series or parallel?” --I am not saying you have it wrong or right here

The answer came from a guy way back in history. --Do a seach for Ohm’s law, he know’s exactly how to hook up your motors.

hi chris the carpenter,

Hi chris,

thanks for all the earlier info on  the ultrasonic sensor, bytes (0-255) etc i understood all that thanks

right as for the motors

Am i correct in thinking :

Parallel - twice the current, same voltage as for one motor (so you need larger capacity cells).
Series - Twice the voltage (twice as many cells) same current draw as one motor

Yep, that’s about the size

Yep, that’s about the size of it.

If you have two identical motors in series, and you put 6V across them, they only get 3V each and the same current passes through both. If you place them in parallel, each gets 6V, and the current for each will be determined by the resistance of the motor. Ideally, each motor in parallel will draw the same (separate but equal) current. In practice, the motors will differ slightly, so one may draw a bit more than the other.

I don’t know what batteries you are using. You can separate out V1 and V2 on the Picaxe board so you can use a higher voltage battery pack for the motors on V2, and not fry your electronics on V1. Keep in mind that the motor driver on the board drops about 1.5V itself. So if you are only giving it 4.5V (3xAA alkaline batteries) you are down to 3V for your motors already. If you split that across your motors in series, what will happen?

** ignoblegnome motors**

i am using 4 AA’s rechargeable batterys at 1.2v giving me 4.8 volts in total.

as for your question would you loose power from the motors ie speed/revolutions due to the volts being split between the two.

how do you connect in series and connect in  parallel ((might sound stupid  but just want check what i have done)

 i see that you stated that you can split V1 V2 to use V2 to power the motors please could i have more informayion on that  ignoblegone

ignoblegone sorry for all the questions but very egar to learn