The Scientist and the Geek

  • Home
  • About
13 Aug 2011

Using LV-MaxSonar-EZ Sonar with Picaxe

Recently I’ve had to develop a circuit using a picaxe 08M2 with MaxSonar-EZ1, and had a bit of difficulty understanding the output values from the sonar analog pin. Although the sonar have a really cool manual that comes in the package, it was still a bit confusing, specially if you don’t read the bellow quote carefully.

"Outputs analog voltage with a scaling factor of  (Vcc/512) per
inch.  A supply of 5V yields ~9.8mV/in. and 3.3V yields ~6.4mV/in.
The output is buffered and corresponds to the most recent range data"

It’s quite straightforward, but can be a bit confusing because the analog reading from picaxe is 0-255 range, which means 5v/255

The code for picaxe would be something like this:

main:
readadc C.1, w1
debug w1
goto main

and the board would look like this:

 

When is all connected in the debug window you’ll see some values of w1 in the 0-255 range, so by using math rule of three, being X the sonar output voltage :

  \frac{5v}{255} = \frac{x}{w1}

which is the same as:

  x = \frac{5v \times w1}{255}

example being w1 = 3:

  \frac{5 \times 3}{255} = ~0.059

So the output is 0.059v, but we know that 1 inch is vcc/512 (in this case vcc = 5v , but could be 3.3v) so is 5/512 (0.0098) and not 5/255 like what we got. So we do again a simple rule of three:

  x in = \frac{0.059 \times 1}{0.0098} = ~6 in

So we get 6inches which is the minimum value readable by the sonar. If we need centimeters we just multiply by 2.54 and get 15,3cm.

so the code will be something like this:

symbol range = w1
main:
readadc C1, range
range = range*5/255*98
'range = range*254/100 'convert to cm
debug range

The values will be different mainly because we are working with integers here, so everything is rounded up.

Don’t forget that if your vcc is 3.3v you should change the constant 5 to 3.

Share
13 August, 2011 at 2:10 by Geek

Tags: 08M2, LV-EZ1, LV-MaxSonar-EZ1, MaxSonar, Picaxe
Posted in Picaxe, Robotics, Tutorials | No Comments »

19 Jul 2011

Light Sensitive leds

A few months ago I wrote a post with some light sensitive headlights for project .netRC, now I had time to implement the circuit on a prototype board to apply it to my new project. Here are some pictures and a small video. To check the circuit and code follow this link

And a small video of it in “action”:

Once again, the code and circuit in this link

Share
19 July, 2011 at 23:54 by Geek

Posted in Picaxe, Robotics | No Comments »

1 Apr 2011

QuadroCopter Tenis…

When I think they won’t do anything else with the quadcopters, they decide to put them to play some sort of tenis…

This is in the Flying Machine Arena in Zurich and they really do awesome stuff there… check the video below:

Share
1 April, 2011 at 14:55 by Geek

Posted in Innovation, News, Robotics | No Comments »

28 Mar 2011

SmartBird

I’ve seen cool aerial devices, quad-rotors, UAV planes even some humming birds that try to fly very clumsily. Now I’ve seen the ultimate robot “bird” flight, very fluid and seems very efficient.

Will it be mass produced and what type of functions will it have, are questions yet to be answered. But made a heck of a cool video ;)

You can check the full specs at the makers website Festo

SmartBird

Share
28 March, 2011 at 13:19 by Geek

Posted in Innovation, News, Robotics | No Comments »

24 Jan 2011

Quadrotor Cooperative Construction Work

Previously I’ve posted some quadrotors making some incredible maneuvers, which can be seen here

Today I’ve seen a article in new scientist from the same research group, with even more incredible stuff.

In short, they used the cooperative quadrotors and special magnetic parts to construct structures. So check out the video below and see the full article at new scientist

Share
24 January, 2011 at 23:23 by Geek

Posted in News, Robotics | 1 Comment »

« Older Entries
  •  

    January 2012
    M T W T F S S
    « Aug    
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  
  • Categories

    • Geekness (24)
      • ActionScript (5)
      • Arduino (6)
      • Augmented reality (9)
      • C# (5)
      • Mash-Up (1)
      • Picaxe (3)
      • Tutorials (2)
    • News (11)
    • Science Stuff (22)
      • Evolutionary Biology (3)
      • Innovation (9)
      • Robotics (12)
  • RSS feed

  • Contact

    scientistandthegeek at gmail.com

The Scientist and the Geek is proudly powered by WordPress
Design & code by Jonk
Entries (RSS) and Comments (RSS).