Components for a voltage sensor/tracker

Hello all, I am a seasoned programmer new to the hardware side of things. I am trying to build a monitor for my boat that will notify me every time my bilge pump turns on and for how long (12v). I would also like it to update my GPS position once per 10 minutes only if the position has changed. Otherwise I would like it to send a “heartbeat” every hour or so to say it is still connected. I plan to send the data to Azure Iot Hub and can build all the notification code myself.

I need help picking the components that would support this. I believe I need the following:

  1. Main board
  2. GPS Sensor (perhaps I can get relative position from the LTE?) I don’t need it to be very accurate.
  3. LTE Support (I have a SIM with a low-cost data plan, and I want LTE for widest coverage)
  4. Voltage sensor to sense when the bilge pump activates (can sense 12v on/off)

Ideally this would be low-energy consuming with the ability to put everything in low-power/off mode while it sleeps. I have 12v power available onboard the boat (but perhaps need to transform it down to 5v).

Can anyone suggest the best components to accomplish this?

@sailorscott, I don’t know how much you want to tinker on this or if you want more of a turn key solution.

If you are looking for more turnkey, you are very closely describing the Tracker One that Particle just released a few days ago. Here is a link for some more info.

Edit: the above link is misbehaving, try this one.

Thanks Backpacker87. This looks great but is not available until July? I am happy to tinker (to teach myself how these systems work). I just found this article which is very close to what I want to do: https://blog.particle.io/learn-how-to-build-this-cellular-asset-tracker-with-a-particle-boron/

The only thing I would add is a sensor to determine when the bilge pump activates (12v turning on and off). I also need to convert from 12v power to 5v to power the sensor.

1 Like

Question: do you have easy access to the voltage directly across the bilge pump motor (e.g. after the automatic switch) ?

I ask because if you only have easy access to the 12V lines that run into the bilge, then you may want to think about monitoring the current passing through that wiring instead.

If you do have access to the wiring after the automatic switch, I would recommend you use a thing called an opto isolator - basically a LED and a photo transistor in the same package. They will isolate the circuits, keeping the nasty, noisy kind of 12V signal that comes with pumps on boats well away from the particle. You will need a little extra circuitry too, but lets get the basics covered first.

If access is difficult, i would suggest looking at Allegro Hall Effect current sensors - these will run off 3.3V just fine and also offer electrical isolation from that nasty 12V line. You wire these in series with the +12V line, and it reports the current flowing (will work fine for DC or AC, unlike a current transformer) - negligible voltage drop, and plenty of nice demo boards available on the 'net for experimenting.

GPS - there’s plenty of different ways to do that, other than waiting for the Tracker One - you can use a waterproof 3rd party GPS and talk to it over a serial port - most of them will spit out NMEA sentences with whatever info you request. Note that reported GPS position will change even when the receiver doesn’t move, so you can either commit to sending the location every sample period, or you can filter the output so that you only report when it has moved more than the usual wander.

So, you have options - how much fun do you want to have ?

Thanks for the reply. I am still coming up to speed on all of this. So, I think my parts list would be:

  1. Basic Feather: Adafruit Feather 32u4 Basic Proto?
  2. 12V -> 5V step down BUCK converter to power from 12v battery
  3. GPS Feather (and antenna): https://www.adafruit.com/product/3133
  4. LTE Connectivity: Particle Boron or Pycom GPy
  5. opto isolator (perhaps mounted on the basic feather) - something like this: https://www.sparkfun.com/products/15105
  6. FeatherWing triple kit
  7. A tight case to hold everything

Of these, #5 is the one I don’t really know how to wire. The Feather 32u4 has space on it for a few chips. It seems I could mount the opto isolator directly there but not sure exactly how to feed the input back into the feather.

Of course I could wait for the Tracker One but the above sounds fun to build.

That list looks good, apart from that optoisolator is too complicated for what you need, I would recommend something simpler like this.

You will want to drop the 12V to 1.2V across the LED (pins 1 & 2 of the one above). I would put an additional diode in series to protect it from high reverse voltages, and a 2K resistor. You can get more fancy for protection, but that should get you going. If you want, you can sling an extra, normal LED in line too, (and adjust the resistor value accordingly) - that way you can get a visual indication of the pump status, even if the boron is not powered or running your code.

Then connect pin 3 to the ground of the boron, and pin 4 to any digital input.
Configure that in your code to be an input with a pull-up, and read the input pin in your code.
0 => pump is on, 1 => pump is off.

You should be able to test all this on a bench, before deploying.

What’s the reason for the 32u4 Basic Proto? Do you need a second micro?
The Boron should be capable enough.

If you just use it for its proto area then the Feather trippler should do just fine as it also has some proto area.

Another option would be to install your system independent of the Boat’s bilge pumps, and monitor for water directly. Especially since one of the main concerns is when the Bilge Pump dies = boat sinks.

A sleeping Boron watching a (2) Float switch via Interrupts.
image
I personally prefer these “duel” floats over the E-Tape water sensors, since we can use them with Interrupts to wake a sleeping device easily.

The Bottom Float’s elevation would be similar to your existing Bilge Float and would trigger normal notifications from the Boron. This would cycle normally following the boat’s bilge pumping events
.
The Top Float would mean a catastrophic situation and the Boron should be sending Alarms to your Email, Cell Phone, etc.

You select the length you want between the (2) floats, depending on how much water you want in the bilge before you get to the Alarm Condition.

This way you are monitoring what actually sinks the boat, not another device that’s prone to failure unfortunately.

Add a tiny solar panel and your system is completely independent of the Boat’s Electrical System.

2 Likes

Now that is an even better idea…

I forgot to mention that you can reverse these Stainless Steel float bowls (take it off the riser and flip it) to swap from Normally Open to Normally Closed, depending on how you want to setup your Interrupts and for power savings. Both Float Bowls are independent switches. For $5 - $10 they are great.

Great idea on the floats! I like having the upper float as it could also trigger an alarm to alert people on the dock where I keep my boat.

So, it sounds like I don’t need a 32u4 Basic Proto, just the Boron (which is unfortunately out of stock currently), the GPS feather, and the triple kit.

I would want to track three things then:

  1. Pump on/off using the optioisolator
  2. Lower float (which should cycle in conjunction with the pump)
  3. Upper float (which would set off all the emergency bells, perhaps including an onboard alarm to alert folks on the dock)

Just so I am clear, I should be able to monitor all this with just the Boron attached to the GPS feather?

The other option is to go with the Pycom boards since they are currently available. I think I would just need the GPy (with LTE) and the PyTracker for GPS. I assume these can also monitor these inputs?

Thanks for the help, this is going to be fun!

Yes, you should be able to do 1, 2 & 3 as well as report your GPS position with the Boron, no need for an additional processor (sorry for missing that earlier, good catch, ScruffR)

1 Like

@sailorscott, these Boron kits are a bit more expensive but available now!

I trick I often use to minimise component count, is to use a 3v3 regular in place of the opto (esp. where low voltages are concerned and where isolation is not the primary reason) - something like this that is cheap and cheerful

https://www.digikey.com/product-detail/en/stmicroelectronics/L78L33ABZ-AP/497-7287-3-ND/1663442

Your I/O then can be setup as INPUT_PULLDOWN and the input will track the 12V down to when the regulator shutdown and will be tolerant of some voltage ripple from the input side.

1 Like

That is a nice trick when isolation or protection from external problems is not required.

Thanks for the tips. I just ordered a set of parts and will start playing around with this.

2 Likes

Report back letting us know how it goes - extra credit for photos.

1 Like

Agreed - these little regulators are usually built really tough and I have even used them for output drivers (ones with an enable pin) so that they will manage over current shutdown etc.

Would a cheap and easy way of sensing the pump not to be add a 12v relay into the circuit then put the boron onto the switch pins? Or, would that be a power drain on the boat and likely to be a bit nosiy too?

The would also work - look for a very low current reed relay to minimise power wastage. But remember you now have mechanical device in your that may have reliability issues in the marine environment - you will find they will probably also cost more that the solutions above and will not be as reliable in the long term.