A-Level Picaxe Project.

  • Thread starter Deleted member 67719
  • Start date
D

Deleted member 67719

Guest
Here's the basic concept of my project:
It is going to be a system which will be placed in a garage - it will warn the driver if the car is getting too close to the wall.

Inputs: Ultrasonic range sensor

Process: Picaxe 20 M2 or X2 (Please advise me to which chip I should use)
Darlington Driver (ULN2003A)

Outputs: Serial LCD Module
Ultra-bright LEDs
Buzzer

Sidenotes: I may also buy the bracket/mount for the ultrasonic range sensor and/or the GBX013 miniature servos.
If I wanted to take it further - I'm going to use an infrared receiver so it can be switched on remotely.

My main question is - which Picaxe chip will be best for this project? What would you change about this project? Is it overly complicated (i'm totally fine with it being complicated)?

Also I want to state that this is just a school project and it is meant as a usable model. I have access to an laser cutter and PCB cutter.

Finally I will explain this project in more detail:
As the driver pulls into the garage the system will turn on. The LCD display will show the distance that the car is from the sensor/wall. On each side of the product there will be a set of 4 Ultra bright LEDs as the car gets closer the LEDs will flash faster. Before the car hits the wall.. the buzzer will sound.
 

Technical

Technical Support
Staff member
Welcome to the forum.
Your project looks fine, and either a 20M2 or 20X2 would work ok for this project.
 

Ravenous

Member
Sounds a good project.

Is the LCD going to be readable from the car? Or is it on the main unit at the back of the garage to help setup & testing.

You might get some extra out of the project by talking about different signalling methods - for example the flash speed is easy to see when not moving, but I think you might not see changes immediately - there's a short interval between each flash so if you're reversing in a hurry you might find it harder to judge distance. Maybe lighting them one by one will be better to judge (or maybe not). Or maybe even a set of bicoloured LEDs that each go from green, to orange, to red as that "distance" is approached. (Just thinking about different interfaces, as people seem to go for "cool looking" stuff these days!)

Do you need servos? I suppose if they tilt up and down it could adjust itself to different size cars, trucks, etc...
 

BeanieBots

Moderator
Some good points raised about the how & why you should do things.
The bi-colour LEDs will of course not be used because up to 1 in 4 males (not sure about females) suffer with some level colour blindness!
 

Puuhaaja

Senior Member
I have played with ur-sensors with lcd's and I'm sure that this project can be done easily with Picaxes. I would recommend you to use breadboard because you can build and test your whole project with that before final construction. You didn't say which ur-sensor you are going to use. I have used very cheap hc-sr04 sensors from ebay but problem with those sensor are that some sensors work and some others don't.
 

cachomachine

Senior Member
I personnaly use a laser pointer fixed to the garage ceiling shinning through the windshield on the car dashboard, i stop the car when the laser dot reaches the middle of the daskboard.
My car is always stopped within about 10 cm.
The laser is turned ON when the door is fully opened (flag attached to the door cutting IR opto sensor) so when it is time to back-up out of the garage, i know i can back-up without checking if the door is fully opened because the laser is ON.
 

techElder

Well-known member
It would be an advantage for the OP if everyone stayed on his topic and didn't start offering "the best" alternatives that he didn't ask about.

I personnaly use a laser pointer fixed to the garage ceiling shinning through the windshield on the car dashboard, i stop the car when the laser dot reaches the middle of the daskboard.
My car is always stopped within about 10 cm.
The laser is turned ON when the door is fully opened (flag attached to the door cutting IR opto sensor) so when it is time to back-up out of the garage, i know i can back-up without checking if the door is fully opened because the laser is ON.
 

Ravenous

Member
The bi-colour LEDs will of course not be used because up to 1 in 4 males (not sure about females) suffer with some level colour blindness!
Aargh I forgot about that! It's very true. I was trying to think of signals which are clear and take effect immediately.

I used to hang around a gliding club. The launch signal to the winch driver was flashing lights pointed at him - slow flashes to slowly wind in the slack, fast flashes to accelerate and launch, a continuous light if a stop is required.

The "Stop" signal was always a bit unclear and slow to read because you're watching a flashing light, and it takes a while to realise it's no longer flashing and has gone to fully lit. So perhaps a row of independent LEDs would be faster to read than a varying pulse.
 

hippy

Technical Support
Staff member
The project looks perfectly suited to a PICAXE and probably any PICAXE could do the job.

Not sure if (even why) a servo may be needed and it might be worth thinking about what is the best user interface. I would perhaps go for a beeper which beeps faster and/or increases in tone as the wall approaches and remains on once at the right distance. Drivers probably won't want to be distracted by bright LEDs or having to read a display when driving towards a wall ! After all, the main problem this strives to overcome is not being sure just how close one is to that wall.

But, no reason not to add more if you feel it makes the project better. In practical terms an OLED display will likely be more readable than an LCD display, but, as it's a project rather than a product, being perfect isn't as important as showing what can be done and what you have achieved.
 

Dartmoor

Member
I personnaly use a laser pointer fixed to the garage ceiling shinning through the windshield on the car dashboard, i stop the car when the laser dot reaches the middle of the daskboard.
My car is always stopped within about 10 cm.
The laser is turned ON when the door is fully opened (flag attached to the door cutting IR opto sensor) so when it is time to back-up out of the garage, i know i can back-up without checking if the door is fully opened because the laser is ON.
This is somewhat flawed if you get a bigger car or let someone else use the garage!

The original post seems fine in concept. Perhaps an OLED may be easier to read than LCD from a distance? Agree with Ravenous' comments about the possible problems with flashing LED's, but trial & error will sort that as part of the project.
 

Dippy

Moderator
I think it's a perfect PICAXE project.

It would need to be a healthy LCD to read when parking - assuming the display is on the wall.
Maybe a GLCD with BIG fonts? Or maybe KIS and just use your LEDs.

If you and your co-parkers aren't colour-blind then no probs surely :)

Most of the run-of-the-mill parking sensors have increasing speed beeps ending in continuous.
Perhaps a similar plan could be done with flashing LEDs - then full on when close.

Where does the servo come into play?
 

stevesmythe

Senior Member
Worth pointing out that I had some real problems getting a cheap HC-SR04 sensor to work with a Picaxe 08M2 and the AXE133Y serial OLED. It worked OK with just a buzzer but (I assume) the power draw of the OLED screen stopped the sensor reading any values greater than 10cm with any accuracy. When I splashed out on the SRF005 sensor, the range was accurate up to about 2.5 metres when using the OLED.

In any case, you might find that 2.5 metres is a tad short to give you much time to react, unless you reverse the car very slowly. Might be worth looking for a sensor with greater range?
 

Dippy

Moderator
Well, I'd have thought (or hoped) you would use your eyes for most of the action :)
Then the sensor for the last metre or two?
 

stevesmythe

Senior Member
Well, I had assumed that the driver would reverse into the garage and drive out as that is the best and safest way to drive so they'd be relying on the sensor more.
 

Circuit

Senior Member
Well, I had assumed that the driver would reverse into the garage and drive out as that is the best and safest way to drive so they'd be relying on the sensor more.
Considering that two and a half metres is near half the length of the average garage, I suspect that the driver can generally be relied upon to know when he is half-way in the garage; even when reversing! I think these sensors will do the job very nicely, as Dippy is suggesting. Remember that the reversing sensors in most cars only start bleeping within the last metre or so. I cannot imagine that there is a need for anything more to assist in reversing into most domestic garages.
 

stevesmythe

Senior Member
Considering that two and a half metres is near half the length of the average garage, I suspect that the driver can generally be relied upon to know when he is half-way in the garage; even when reversing! I think these sensors will do the job very nicely, as Dippy is suggesting. Remember that the reversing sensors in most cars only start bleeping within the last metre or so. I cannot imagine that there is a need for anything more to assist in reversing into most domestic garages.
OK maybe I am being a bit pessimistic but it's not a bad idea to think of worst-case scenarios when designing things. In a commercial car system, the sensor is optimally mounted behind the bumper, the instrumentation is around 60cm from the driver's head and the warning buzzer plays through the car stereo system. In this project, it might not be possible to mount the sensor optimally (e.g. to avoid it getting crushed in the event of a collision), the instrumentation will be a moving target between 5m and 2.5m from the driver's head, and the buzzer will be outside the car and probably difficult to hear through the windows, above the engine noise. Hence my suggestion to consider distance sensors with greater range to allow for all of that. No harm in thinking through those sorts of issues in this sort of educational project.:)
 

Circuit

Senior Member
Aargh I forgot about that! It's very true. I was trying to think of signals which are clear and take effect immediately.

I used to hang around a gliding club. The launch signal to the winch driver was flashing lights pointed at him - slow flashes to slowly wind in the slack, fast flashes to accelerate and launch, a continuous light if a stop is required.

The "Stop" signal was always a bit unclear and slow to read because you're watching a flashing light, and it takes a while to realise it's no longer flashing and has gone to fully lit. So perhaps a row of independent LEDs would be faster to read than a varying pulse.
If you watch Formula 1 racing, the start signal is a row of red lights that come on in sequence and then they all go off to indicate "start". If you have a row of lights in your system they could come on in sequence and then all go off when the optimal position is obtained. This would also provide a failsafe in case of system failure; "all off" indicates "stop now", regardless. Taking your concept of "totally fine with complicated", you could link your sensors at the rear of the garage to a display board at the front, say next to the driver's side window or perhaps above the garage door so that the lights are seen easily.

Cachomachine's note on the laser pointer playing upon the car bonnet is not without value and such notes can promote lateral thinking; you could perhaps link your ultrasound sensor to a laser pointer display that plays on the car bonnet, pulsing according to distance in the manner of the glider signal. Also his note that it is activated by a"flag attached to the door cutting IR opto sensor" may give you an idea about how you can trigger your device. In thinking through these projects, of course, there is also the possibility of over-complicating a simple task and the design engineer does not want to end up with egg on his face by making a massively complicated device when there is a simple solution. Therefore I rather disagree with Texasclodhopper suggesting that Cachomachine has gone "off topic". My garage has a white line painted on the side wall with six inch lettering denoting "windscreen pillar aligns here". This was the solution that the previous owner used to park his Rolls-Royce in the garage - a very simple and easy solution indeed! For a student involved with an A-level project, it is imperative to think around the project from all aspects. A-level projects are evaluated and marked and therefore there is a need to think around the subject very carefully and look at existing and alternative technologies.

In the UK we have television programme called "Dragons' Den" in which inventors present their ideas in front of a panel of hard-nosed business people who either invest in the idea or reject it; sometimes with quite harsh comment. I recall one presentation where two chaps had invented an insert for gallon cans to stop them gurgling and splashing when pouring out; one of the businessmen rose from his seat, took the can and simply held it flat-side up whilst pouring and, of course, no gurgling or splashing! The two "inventors" stood bewildered and red-faced; a simple solution that outwitted their invention. Perhaps they had never been boy scouts!

The bottom line, therefore, is that the innovator should always examine existing technologies when approaching a design project - especially when it is not a hobby project but a project for evaluation at school. You are on the right lines with this idea, but think laterally and see if you an add a real innovation to what is existing technology. PICAXE is the perfect foundation for what you are proposing.
 

techElder

Well-known member
All valid points, however, my thinking is based on experience here and posts going considerably away from the OPs original request for help. I'm also thinking that there is already an instructor in the OPs circle that is driving the task's evaluation process. No need for duplicating that process here even with the esteemed population of this forum.

Circuit #18 - In thinking through these projects, of course, there is also the possibility of over-complicating a simple task and the design engineer does not want to end up with egg on his face by making a massively complicated device when there is a simple solution. Therefore I rather disagree with Texasclodhopper suggesting that Cachomachine has gone "off topic".
 

hippy

Technical Support
Staff member
It is also quite likely the project is intended to assess the student's aptitude for software engineering more than anything else. Sometimes projects may have to be a little contrived to achieve that goal and may not be the optimal solution in practice.

Adding a voice announcement which proclaimed "Well done; you parked your car well today" would probably be considered ridiculously over the top, but it would demonstrate having all the skills needed to do that.

Actually; having a voice 'talk down distance' might not be a bad idea. There may be extra marks as well for considering health, wellbeing and disability issues. It would be an absolute boon for blind drivers.

No, seriously ...

http://www.blinddriverchallenge.org
http://www.motorweek.org/features/fyi/blind_driving
 

Dippy

Moderator
The voice countdown might not be so good for deaf drivers though :)

Anyway, what does the OP think?
I suspect getting 'something' up and running is the first task?
Or is it one of those things where you build the basics and write a report on how it could be developed?
(i.e. showing you can make the guts and also discuss the potential).
 
D

Deleted member 67719

Guest
Hi, yes i'm currently ordering all the parts. I'm doing a lot of research on some of the parts; like the darlington drivers (I have never used one before).
Since I want to use servos to control the movement of the ultrasonic range sensor http://www.picaxestore.com/index.php/en_gb/gbx013.html ,do I simply cut-off the connector and connect the white wire onto the picaxe output?
 

AllyCat

Senior Member
Hi,

post: 271213 said:
do I simply cut-off the connector and connect the white wire onto the picaxe output?
Well, you could cut off the connector, but the servo still needs supply and ground connections, so IMHO it would be far better to connect it to 3 standard pins on the prototype / circuit board. The connector needs hardly any space, and debugging often can be much easier if you have the ability to rapidly (and reliably) disconnect and reconnect individual components. But yes, the central wire needs to connect to a suitable PICaxe pin.

Cheers, Alan.
 
D

Deleted member 67719

Guest
UPDATE:
I've started the designing phase...

I can't seem to find any useful documentation which will help me use the darlington driver array.
Here's a screenshot from PCB wizard: Have I connected the picaxe and darlington correctly?
pic and d.png
 

Ravenous

Member
I've normally used the ULN 2803 or 2003. I THINK the 2804 you have shown is for a different logic voltage, I do not know if this will work or not. Perhaps someone else can chip in?

Otherwise, I think the layout looks like it will work. Only if V+ is 5 volts though. The manual 3 that Eclectic mentioned above will work for "+V" at other voltages too, but in that case a +12V (say) line should not connect back to the picaxe.

You should also think about decoupling capacitors too, near the picaxe chip itself between its 5V and 0V lines. Just to reduce possible interference problems and so on. These get mentioned on the forum quite a bit.
 

geoff07

Senior Member
Is this for GCSE DT? If so, be careful not to overdo the technology! It is a great project, BUT time is limited, and making something clever that works is far better than something extremely clever that doesn't!
 

grim_reaper

Senior Member
The thread title suggests A-Level; but not the subject - i.e. DT or 'electronics'. At least, those were the choices in my day!

As far as I remember, the criteria for getting full marks on a school project at this level [age 17 or 18 for those unfamiliar with the UK system] is to 'show your workings'. If the project doesn't actually work, but the design and documentation are top quality, you can still get an A*, (as I proved after weeks of worrying, as my final project didn't actually do anything due to a badly made PCB!!)

But geoff07 is right, whether it's design, paperwork or physical construction; time is limited and must be planned.
 
D

Deleted member 67719

Guest
The thread title suggests A-Level; but not the subject - i.e. DT or 'electronics'. At least, those were the choices in my day!

As far as I remember, the criteria for getting full marks on a school project at this level [age 17 or 18 for those unfamiliar with the UK system] is to 'show your workings'. If the project doesn't actually work, but the design and documentation are top quality, you can still get an A*, (as I proved after weeks of worrying, as my final project didn't actually do anything due to a badly made PCB!!)

But geoff07 is right, whether it's design, paperwork or physical construction; time is limited and must be planned.
Yes you are correct. The majority of the marks come from the portfolio. For example I should take pictures of every step of my project and I must show the processes/machines used (like a laser cutter or PCB engraver). However since this IS engineering my teacher has suggested that I should include something 'mechanical' in my project. So my current idea is to remove the second servo, which controls the X axis (left/right) and include a motor which is connected to a bearing disk. (I have made a mount with holds the range sensor which is attached to the up/down servo) <-- this will be placed on top of the bearing disk.
Anyway I'll this thread will be more active as I will post a couple of pictures ;) (And I may have a few questions about the code...)
 

bpowell

Senior Member
Are there more components on the bottom of the PCB? I don't see decoupling caps, etc...you could have some erratic behavior w/out them.

(Posting from experience)
 

rq3

Senior Member
post: 270689 said:
Here's the basic concept of my project:
It is going to be a system which will be placed in a garage - it will warn the driver if the car is getting too close to the wall.

Inputs: Ultrasonic range sensor

Process: Picaxe 20 M2 or X2 (Please advise me to which chip I should use)
Darlington Driver (ULN2003A)

Outputs: Serial LCD Module
Ultra-bright LEDs
Buzzer

Sidenotes: I may also buy the bracket/mount for the ultrasonic range sensor and/or the GBX013 miniature servos.
If I wanted to take it further - I'm going to use an infrared receiver so it can be switched on remotely.

My main question is - which Picaxe chip will be best for this project? What would you change about this project? Is it overly complicated (i'm totally fine with it being complicated)?

Also I want to state that this is just a school project and it is meant as a usable model. I have access to an laser cutter and PCB cutter.

Finally I will explain this project in more detail:
As the driver pulls into the garage the system will turn on. The LCD display will show the distance that the car is from the sensor/wall. On each side of the product there will be a set of 4 Ultra bright LEDs as the car gets closer the LEDs will flash faster. Before the car hits the wall.. the buzzer will sound.
For a garage parking "sensor" I use a tennis ball hanging from a string. When the ball hits the windshield, I'm done. I'd LOVE to see the tennis ball replaced by a glowing sphere containing a Picaxe, a sonar sensor, and some multicolored LEDs! And the "string" could be a couple of wires to provide power from a wall wart.

Multi-Million dollar idea. I'll take 1% of your gross when you launch this on KickStarter! Forget patents, it's now in the public domain! GO, GO, GO! First to market wins!

Rip
 
D

Deleted member 67719

Guest
Are there more components on the bottom of the PCB? I don't see decoupling caps, etc...you could have some erratic behavior w/out them.

(Posting from experience)
There are capacitors on the voltage regulator board but i'm guessing they aren't close enough to the IC (did a bit of reading about decoupling capacitors on the forum). Would I just have a capacitor across the V+ (going to GND) Picaxe chip? I'll make sure to include a decoupling capacitor on my motor/servo control circuit board; which is the next step for my project.
 

nick12ab

Senior Member
post: 281333 said:
There are capacitors on the voltage regulator board but i'm guessing they aren't close enough to the IC (did a bit of reading about decoupling capacitors on the forum). Would I just have a capacitor across the V+ (going to GND) Picaxe chip? I'll make sure to include a decoupling capacitor on my motor/servo control circuit board; which is the next step for my project.
Yes, a 100nF capacitor connected to V+ and GND close to the PICAXE chip.
 
D

Deleted member 67719

Guest
Hello, I just attempted to program the main circuit for the first time. I can already tell that there are all sorts of problems... For example you can notice the LEDs flickering. The major issue is that I can hear a slight buzzing noise from the ultrasonic sensor (due to the fact that its been pulsed too often). Could someone give me some pointers on how to improve my program?

Code:
main:
   ultra C.2, b1   ; measure the distance
   if b1 > 0 and b1 < 9 then goto BUZZER
   if b1 > 10 and b1 < 30 then goto LED1
   if b1 > 31 and b1 < 50 then goto LED2
   if b1 > 51 and b1 < 80 then goto LED3  
   if b1 > 81 and b1 < 100 then goto LED4
   if b1 > 101 and b1 < 255 then goto main             
   pause 200 	   ; wait 200 ms 
   goto main
   
BUZZER:
   high c.6
   high b.4
   high b.5
   high b.6
   high b.7
   pause 125
   low c.6
   low b.4
   low b.5
   low b.6
   low b.7
   goto main
   
LED1:
   high b.4
   pauseus 500
   low b.4
   goto main

LED2:
   high b.5
   pauseus 500
   low b.5
   goto main
   
LED3:
   high b.6
   pauseus 500
   low b.6
   goto main
   
LED4:
   high b.7
   pauseus 500
   low b.7
   goto main
 

bpowell

Senior Member
Slow your program down to start.

Just grab the range, and debug...make sure that is working correctly, then try lighting up LEDs based on range values...

But change that "Pause 200" to "Pause 2000" and work through the code one feature at a time.

Also, take a look at your last IF-Then...add a "Pause 2000" in there as well...if b1 > 101 and B1 < 255 then pause 2000 : goto main
 

hippy

Technical Support
Staff member
Note that your code does not catch all values of 'b1', for example, consider when 'b1' is exactly 10 ...

if b1 > 0 and b1 < 9 then goto BUZZER
if b1 > 10 and b1 < 30 then goto LED1
 
Top