Vehicle monitoring system using Arduino Uno

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey guys, Im currently doing a Microprocessor course and I have a project that I am struggling with. I have to build a vehicle monitoring system using the Arduino uno. The parts that I must use are a 7 seg display for counting, a tcst 1103 optocoupler, 3 LED's and some switches. On top of all this, I am required to write the code in assembly. Basically it needs to work as follows. A yellow LED is on by default and when a car is detected, the green LED will come on and the display will display 1. This will continue until the display reaches a count of 9, in which the red LED lights up. Thank you all for your time. 

SM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So what have you come up with so far & what exactly do you need help with

 

We may be prepared to assist you with your understanding but no-one here is going to complete your course assignments fro you.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you are making a car counter.  THats pretty simple enough and can be fun as a starter project.

 

What is the opto-coupler for?  The switches?

 

It MUST be written in Assembly?  On an UNO?  Really?

 

JIm

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to the Forum.

 

Fun project, but not trivial if you are new to micros.

 

Start simple:

Read up on how to configure an I/O pin for either input or output mode.

 

Write a simple program to turn On any of your three LEDs, and keep the others off.

 

Write a simple loop to flash an LED on and Off, (this requires you to write a delay loop function).

 

Write a simple program to read an input on a pin and then turn an LED on or off based upon whether the input is high or low.

You can test this with a simple push button switch, with an external 10K pull - up resistor.

 

Then try doing this with your opto-coupler as the input instead of the push button switch.

 

Now comes the more interesting part of the project.

 

Read up on the Timer/Counters, and on how to set a T/C up for CTC mode to fire an interrupt at a rate of once every 1 mSec.

Use the Interrupt Service Routine to count up to 500 and toggle an LED.

The LED should now flash at once per second, based upon your T/C interrupt.

Getting this working is a big step.

 

AFTER you have successfully done the above, then we'll discuss how your 7-segment is wired up, and the steps needed to display data on it.

 

One step at a time and the project is doable!

 

JC

 

Edit: Typo

 

Last Edited: Sun. Sep 10, 2017 - 06:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Moderator,

 

Perhaps this belongs in the Mega/Tiny Forum?

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So far in the course we have done the blinking led with a delay function and timers. What I'm currently struggling with is with the optcoupler. Not sure how to wire it and code for it

SM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My course coordinator insists that we do it in assembly

SM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So far in the course we have done the blinking led with a delay function and timers. What I'm currently struggling with is with the optcoupler. Not sure how to wire it and code for it

SM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

Moderator,

 

Perhaps this belongs in the Mega/Tiny Forum?

 

JC

Seems the OP is more concerned about the Opto coupler:

Shivesh wrote:
What I'm currently struggling with is with the optcoupler. Not sure how to wire it and code for it

 

So I'll leave the thread here....for now

 

Jim

 

To the OP:

 

Show your schematic, and what the Optocoupler is for and we can help.

 

Jim

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The optocoupler is used for detecting movement, also forgot to mention that when movement is detected a sound will be made via the speaker. The higher the vehicle count, the more intense the sound.

SM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Shivesh wrote:
The optocoupler is used for detecting movement,
Are you SURE you mean "opto coupler"? It's true they contain both a light source and a detector, which is what you might require for "car counting" but in a "coupler" the two are just a millimetre or less apart inside a package. You presumably need a light source (IR?) and an optical detector that are several feet apart as separate components?

 

BTW are we talking about detecting full size (6 feet+ wide) cars here or just model cars on a small track (perhaps a few inches wide?).

 

FYI, the usual use of an opto-coupler is where you have two isolated electrical circuits and you want them to share signals but not be electrically connected so the signals "cross the barrier" as light. But, as I say that "barrier" is very small.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Detecting small cars 

SM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The teacher has probably set a task similar to https://www.kitronik.co.uk/blog/...​.  I suggest the OP reads the link.  

 

David 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Shivesh wrote:
Detecting small cars
"small" still says nothing about the thing you are trying to detect. To me "small car" says:

 

http://2.bp.blogspot.com/-Zszp6dtEX-g/Uj8GYXSigzI/AAAAAAAACzo/_AWXJSIEwwE/s1600/k.jpg

 

or perhaps even:

 

Image result for small cars

 

but maybe you mean:

 

Image result for model cars

 

or possibly even

 

Image result for smallest model car in the world

 

I suspect you really mean:

 

Image result for scalextric cars

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Shivesh wrote:

...a tcst 1103 optocoupler...

 

 

clawson wrote:

Shivesh wrote:
Detecting small cars
"small" still says nothing about the thing you are trying to detect...

 

I suspect you really mean:

 

Image result for scalextric cars

 

 

Much smaller than that Cliff. The gap between emitter and detector is a slot 3.1mm wide.

 

 

Shivesh, perhaps you need to sit down and DESIGN your system before you try to write code. You need to answer many questions including things like how is the car going to interrupt the light in the opto-detector (not opto-coupler).

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Google arduino tcst1103
The tcst1103 is described as a opto detector, not an opto coupler. Similar, but different.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can add a vane on the car or have the car hit a paddle each lap to put a vane through the 1103.  Similar optos have been used in Pinball machines for years.

  

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Google arduino tcst1103

Image result for tcst1103

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
The gap between emitter and detector is a slot 3.1mm wide.
OK so...

 

Image result for smallest model car in the world

 

after all! cheeky

 

So, that bit across the bottom that makes the "slot". Is that just plastic construction or is anything in it? Otherwise a hacksaw gets you this....

 

But I guess there's some limit on how far from the transmitter the receiver can detect it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
 that bit across the bottom that makes the "slot". Is that just plastic construction or is anything in it? Otherwise a hacksaw gets you...

I would guess that it's just plastic.

 

They're only 66p ea in Farnell - so wouldn't cost much to just try it!

 

But I guess there's some limit on how far from the transmitter the receiver can detect it?

The optics are probably optimised/focussed for the fixed distance ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

awneil wrote:

They're only 66p ea in Farnell - so wouldn't cost much to just try it!

 

Or if you've got a big pile of them waiting for the next production run...

 

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And what's inside...

 

 

Emitter on the bottom, detector on the top.

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As Andy says, the optics are probably optimised so that any "lens" (well, OK, "bump in the plastic") focuses the transitter's output to the receptor's input. So this may not work more than a few inches apart?

 

I have to admit I didn't look up the "tcst 1103" mentioned in the first post previously but can anyone think why the course tutor would have suggested the use of such a part if this really is about counting model cars that are 6"+ wide ? It's a totally inappropriate component for the job UNLESS we are talking about "slot cars" and somehow embedding that sensor in the Scaletrix track so the car breaks the beam in the slot itself perhaps??

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
 can anyone think why the course tutor would have suggested ... 

Maybe the choice was explained in class, but the OP just wasn't paying attention ... ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Shivesh wrote:
The optocoupler is used for detecting movement,

clawson wrote:
Are you SURE you mean "opto coupler"? It's true they contain both a light source and a detector, which is what you might require for "car counting" but in a "coupler" the two are just a millimetre or less apart inside a package.

Like this:

Image result for tlp291 Image result for tlp291

 

Last Edited: Wed. Sep 13, 2017 - 10:40 AM