I'm Trying to make a start/stop timer using IR sensor to calculate the fees of a parking by multiplying the time by constant price, when the car cuts the ir sensor, the timer starts and when it moves away the timer stops. Can anyone help in coding? Also i want to display the final price on LCD
Youre going to want to research non blocking timers using the millis() command.
Also, search how an if statement works. Lastly, have you determined weather you get a high, or low signal when the car is parked, versus an empty spot?
You should be able to combine an if statement, the pin condition youre looking for, and a non blocking millis timer to get a value.
Youd multiply this value by a huge value number if your parking meter is going to be realistic like here in florida lol
There are lots of parts in the project as you have described it. What physical pieces do you have and how do you have them connected? A block diagram with identified blocks and lines representing the wire connections would be great to start with.
You can't consider any "coding" until you know in detail what you have and how those pieces are connected.
As you get started, think about progressive scaled pricing… e.g first 5 minutes, $1… next 20 mins $0.20/min
How are sensing the vehicle presence ?
IR where ?
Yes.
Post your sketch, well formated, with comments and in so called code tags "</>" and schematic to see how we can help.
(post deleted by author)
(post deleted by author)
How does the exiting system know when a slot is empty? Couldn't that also be used to know when a slot is not empty?
The orange marks on the photo are IR sensors detect the cars and display it on blynk
So i want to add new ir sensor with arduino and Lcd to Make a timer, the timer starts when the car cuts the ir and stops when the car moves away, Then calculate the fees and dislapy the fees on the LCD
Why add new IR sensors when you already have IR sensors?
How to do it:
When the sensor goes from Empty to Not Empty, store millis() in an array entry for that parking spot.
When the sensor goes from Not Empty to Empty, subtract the stored value from millis() to get the amount of time the slot was Not Empty. Calculate the toll based on the elapsed time and display it on the LCD.
I got it, do you have the code that start and ends this timer then subtract them to get the total fees?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.