Showing posts with label picaxe. Show all posts
Showing posts with label picaxe. Show all posts

Sunday, January 31, 2010

GPS Speedometer project

Here is a project I worked on a couple of months ago that I thought I'd like to post before I "reclaim" the parts into something else.


Inside the trendy "lunchbox" is a small GPS sensor and a PICAXE that work together to display the current speed in Kilometres-per-hour (KPH) on the display - forming a universal speedometer. In an attempt to make this project as simple as possible, the PICAXE uses PWM to output 0-200mV to a 0-200mV DC Voltmeter. This removes the need for a (more expensive) dedicated LCD as the circuit can be connected to any multimeter with a 200mV range setting.


The program reads in the KPH from the GPS unit (one of these) using the serial pin, multiplies that number by 4 and sets its PWM output to the result.

The PICAXE code is available here on GitHub.

The PWM output ranges from zero the supply voltage to the chip - in this case 5V. This is then limited to 0-3V by a Zener diode and further reduced to 0-200mV using a potentiometer wired as a voltage divider.

The result is an accurate speedometer that can be used in a car, boat, bicycle, motorcycle without any sort of special configuration and that costs virtually nothing. Performance-wise, it updates once every second and the speed is steady and accurate to within +/- KPH at highway speeds.

Sunday, April 26, 2009

Testing out the sonar sensor


Just a short video of the Maxbotix EZ0 sonar sensor hooked up to the helicopter. The code running on the Picaxe simply reduces the pulse-width to the servo by 20% if something is closer than 30cm. This is too close for actual use, but demonstrates the concept.

I was going to have a lot more to show from today, but 20 seconds after I finished filming this, the batteries in my rc controller went flat, the helicopter took on a mind of it's own, flipped over and proceeded to rip off the top rotor...

Wednesday, April 8, 2009

A different project

Whilst I sort out some annoying rs232 problems with my Arduino, I have been working on a couple of little projects, one of which I can show a bit of today.

This starts with a little history. I have always been interested in flying contraptions, and a while ago, on an impulse, I purchased a LAMA V4 RC Helicopter (below).



The LAMA is a basic, easy to fly, Coaxial helicopter. Obviously, as soon as I had learnt to fly it, I started modifying it. Since then, it has been converted into a small, light-weight platform for some future robotics experiment.

...A year passes...

Now, to the present, and I will show you a video. This is the LAMA in it's current state, being flown relatively badly.





The important thing about this video is the details, specifically that I have inserted a PICAXE-08M chip in between the output of the RC receiver and the back-and-forward tilt servo on the helicopter. The point of this is to test the accuracy of the PICAXE's pulsin and pulsout commands. The program on the PICAXE simply listens for a pulse from the RC receiver's servo connector then repeats that pulse, sending it to the servo. The PICAXE is installed as shown in the following two images (click to enlarge).




The point of all this is to verify that the PICAXE is capable of accurately and quickly repeating Servo control signals. This has been verified, as the helicopter flew as well as it did before the modification, with there being absolutely no difference in the fidelity or response of the servos. Based on this, I intend to connect an accelerometer (possibly this one at Maker Shed) to this PICAXE, allowing the helicopter to maintain a steady forward/back position in space. This will be expanded to left/right as well after the accelerometer's integration is finished.

The most awesome part of this experiment is the simplicity. Anyone, with a $5 IC, can interface and interfere with the signals to an RC servo, and do so in a high-accuracy manner. Adding to this simplicity is the fact that (in this case, at least) the PICAXE is powered from the power supply to the servos, which was 5V.

The PICAXE-08M code for this example is as follows:

main:
'read a pulse in
pulsin 4,1,w0

'pulse it out
pulsout 0,w0

'loop
goto main

The circuit is simple too (click to enlarge):



I just have to name whatever it will become now. How about PICopter.