Datalogger + solenoid.

Hi all. I am building a datalogging device as part of my Honours project. I am an environmental science student and I have absolutely no experience in electronics or coding. Also there is no electrical engineering department at my uni so I am reaching out to the online community for assistance!

Ok so what we are trying to do is design an automated trap to measure the amount of methane released from wetlands. What I need to do is read data from a sensor every 10 min and log onto sd card (the sensor will be sharp IR sensor or a e tape sensor 8 eTape Liquid Level Sensor + extras : ID 463 : $39.95 : Adafruit Industries, Unique & fun DIY electronics and kits not sure which we will use yet) . Also when the sensor value returns a certain amount I would like a solenoid valve to open up for x amount of time. This is to drain the trapped gas out once a certain amount has come in. The aim of this is to be deployed in the field for up to 1year at a time.. although first i need to prove the concept so it only needs to run for 3 days. I have purchased an arduino nano, a ds3231 RTC module, a micro sd breakout board, the sensors, a breadboard and a 12v solenoid.

Questions:

  1. Power. The circuit will not draw much power the sharp sensor is around 30ma and the arduino itself is also around 30ma and the solenoid is 350ma. Can i use a 12v battery into the VIN pin of the arduino and take the solenoid power out of that also? or would that cause the regulator of the arduino to heat up too much during long term use? Is it possible (better) to have 2 different power supplys? a 12v battery for the solenoid and a few AA in parallel to make up 5v for the nano + sensor? How would I hook this up?

  2. Coding. I would like the have the nano in sleep mode and then be woken up by an interrupt from the RTC every 10 min. When it wakes it will take 30 seconds of sensor data and log to SD card with timestamp from the RTC. If the sensor data is at a certain value then the solenoid will open for x amount of seconds then close. Then it will sleep again for 10 min. At the moment I just want to know if this is possible! any tips would be greatly appreciated!!

halo. as for your power to the solenoid, connect a relay unit to the arduino then you can run a power source to the solenoid via the relay instead of trying to pull the power for the solenoid out of the arduino. and as for your coding, yes it is possible, you can program a sleep dog timer that will activate the unit according to the time set with the rtc and do all your recordings and switch off again when complete. Adafruit has a datalogger and you can get an rtc shield to fit on it you can connect that to a battery and then use the relay system to activate the solenoid.

Some Arduino boards can be powered by a 12V battery (Uno, 101).

A quick calculation for battery power assuming 30 seconds operation every 600 seconds (5%) and the solenoid is only energized for a short time and infrequently

60mA * 5% + 350mA * .1% = 3.35mA (0.00335 Amps) average current

0.00335 A * 24 hrs/day * 365 day/yr = 29.3 AmpHr

You need to add some margin because there will be some self discharge over the course of a year and the current draw will not be zero when powered down so I would look for a 50-100 AmpHr capacity. If using lead acid then a sealed deep cycle battery is called for. If you have access to power at the site to keep the battery charged or can add a solar panel then you need a much smaller battery. You don't say where this will be, but most batteries don't do well near freezing temperatures and below.

The biggest problem I see is in protecting the electronics from the environment for an entire year. Water and bugs can get into almost anything. Wind and larger animals can break things and tip them over.

Best of luck. It sounds like a cool project.

"Also when the sensor value returns a certain amount I would like a solenoid valve to open up for x amount of time. This is to drain the trapped gas out once a certain amount has come in."
What will take the gas's place? More of the same gas? Will there be a fan or something to flush the old gas out?

Power - I'd go with a Promini, or a standalone build even, to save more power vs having a USB/serial chip and power LED and voltage regulator powered all the time.
You mentioned an RTC - use the alarm output of that to turn on a high side switch to power up the uC, let it power up the rest. Ultimate in power down operation!