Forum Replies Created
-
AuthorPosts
-
February 27, 2021 at 5:04 pm #1640Sylvester DzimiriParticipant
Hey Stacy, Thanks for the link; such a great post. You are right that you can use the “millis” function. This is what I used in my project to see how much time has passed before sending sensor data. I have attached some of the snippet code on how I instantiated the millis object and keep track of the time. I think you also want to do something along those lines.
//initialize times gas_time = millis(); flame_time = millis(); pir_time = millis(); sound_time = millis(); temperature_time = millis(); ultrasonic_time = millis(); //PIR sensor pinMode(PirInput, INPUT); } void loop() { // put your main code here, to run repeatedly: unsigned long time_passed = 0; //device #2 //read gas sensor // don't read analog pins too often (<1Hz), else caps never get to charge. time_passed = millis() - gas_time; //if roll over, send next value again if (time_passed < 0) { gas_time = millis(); gas_time_send = -700000; }
I hope that might be helpful. I am sure you also read their documentation but I am attaching the link (https://www.arduino.cc/reference/en/language/functions/time/millis/)
February 26, 2021 at 1:53 am #1492Sylvester DzimiriParticipantI think the project is great! Correct me if I am wrong but at the moment, you are recording the forward and backward movements of the car and the engine status?
Do you guys plan to record more functionalities, like car speed, and if so, are you going to need an alarm when your measurement goes outside of a specified range of values? If so, how do you want to be notified?
February 26, 2021 at 1:48 am #1488Sylvester DzimiriParticipantDo you plan to have the logger download data to your PC remotely?
You can look into Wi-Fi and one of the low-cost and popular Wi-Fi microchips is the ESP8266 (https://www.sparkfun.com/products/17146). Other alternatives can be Bluetooth, yes, and/or proprietary RF links.
February 26, 2021 at 1:41 am #1486Sylvester DzimiriParticipantI am not sure if you guys looked into the RTC library. You can use the DS1307 Real Time Clock breakout, you will need to install the library from GitHub to begin working with that.
https://github.com/adafruit/RTClib
https://www.adafruit.com/product/264This is also the RTC library (https://www.arduino.cc/en/Reference/RTC) and it has some examples to start with.
-
AuthorPosts