More efficient way to make pins low??

Status
Not open for further replies.

pak

Member
I am prototyping a bilge pump counter and have a few questions. Please see the attached schematic. I would like to know how to eliminate the 12 V relays and still make Pins 2 and 3 LOW when applying 11 to 14.5 VCC through S1 and S2. All options are on the table. My objective is to... 1) have as small a footprint as possible, and 2) keep costs low. I have already written the code and tested this on a breadboard as shown.

Thanks,

Drew
 

Attachments

  • Counter.pdf
    14.5 KB · Views: 185
Looks like you could use NPN transistors instead of those relays. 2N3904 would be good. Connect the emitter to ground, collector to the Teensy pin, and connect your 12V signal through a resistor to the base. 10K would be fine to use. You might also add another 10K from the base to ground if they're too sensitive. If they response to radio waves or other high frequency noise, add a 0.01 uF capacitor from the base to ground.
 
New Schematic based on Paul's suggestion

Paul,

Thanks for responding so quickly. Do you never sleep.:) Can you tell me if the attached Schematic represents your suggestions? Thank you so much.

Drew
 

Attachments

  • Bilge Pump Counter w 2N3904.pdf
    13.9 KB · Views: 168
That'll work. You'll have to configure the Teensy's input pin as INPUT_PULLUP when reading -- else nothing will pull the pin up to +3.3 V when the NPN is off.

In case you have noise or spikes, maybe make the 10k input R's (from the pump) 33k. That will make it a little less sensitive.

Note that you may get many transitions on the Teensy's input when the input switch closes because of interference, switch bounce etc. You'll have to filter those in software.
 
Thanks to all for your help, my project is up and running, albeit with a few changes. First, I have eliminated S3. Rather than use a push-button switch to alternate between displaying bilge 1 and bilge 2, I wrote code to toggle between the two for about 10 seconds each. I also changed the input mode to INPUT_PULLUP on pins 2 and 3 as suggested, and because it appears to be very stable, I did not use the CAPS to ground. Below is what it does so far. Items eight and nine have not been implemented yet.

My sketch is designed to do a number of things:
1. It counts the number of times each bilge pump comes on
2. It logs the start and end time of each occurrence on a mini SD card
3. It logs the duration of each activation
4. It logs the date and time using RTC
5. It displays the current count on a seven segment LED display
6. It alternates between displaying bilge pump 1 and bilge pump to 2
7. It displays the corresponding pump number in the first digit of the LED
8. It sends an SMS message to my cell phone each day
9. It warns me if a bilge pump comes on for an extended time


There are two issues which I have yet to resolve. First, the 5 V regulator gets very hot when subjected to 14.5 V. I have a 12 V battery system on my boat, however when the engines are running, the batteries may [sometimes] charge at 14.5 V. It is uncommon, but it does happen. I had to machine a heat-sink for my 5 V regulator, otherwise it got too hot to touch. My plan is to use a 12 V regulator and redesign the circuit using a voltage divider after the regulator to provide somewhat less than 5 V to the Teensy. Converting 14.5 V to 12 V should result in much less wasted energy, thus less heat.

My next step is to implement items 8 and 9. I have absolutely no idea how to do that, so it will take me some research to figure it out. If you all have any suggestions where to start, I’ll take anything I can get.

Again, thank you all so much for your help.

Drew
 

Attachments

  • Bilge Pump Counter w 2N3904.pdf
    13.6 KB · Views: 195
Last edited:
The 150k & 100k you show won't work -- basically they won't provide enough current for the Teensy or the other loads. If you make the resistance low enough to work, you'll end up dissipating more power in the regulator.

There's no easy way around the power dissipation -- unless you use a switching regulator (DC/DC converter). An advantage of that also is that it will reduce the total load current on the battery if that is a concern.

Lacking that, the best thing is to
 
You are absolutely right. The Teensy, LED display and SD reader take 85ma. :( Shows you how much I know about Ohm's Law. I thought about a buck converter, but I wanted to keep the footprint small. I may have to do that anyway. Thanks for your feedback.

Drew
 
Last edited:
Given the operating environment I'd say you really want a switching regulator. There are a whole bunch of choices depending on price, patience and board realeste including these
https://www.adafruit.com/products/1065
which drop in as a 78xx replacment or onehorse's backpacks
https://www.tindie.com/products/onehorse/mpm3620-buck-converter-/
Or you can grab a car USB charger and hack it apart.
Regardless of how you do it a rule of thumb is to use a switching regulator rather than a linear regulator for anything more than twice your supply to reduce you the heat dissipation .
 
The OAK ESP8266 KStart I'm awaiting just announced his chosen LDO is good for 500ma - then pointed out the heat issue on burning extra volts and offered a $4 china unit to .

using the SPX3819 - it is a 500ma 3.3v regulator. ... can - produce 3.3v at 500ma or more, do so even with a single LiPo cell input, and also handle inputs over 5.5v, while producing very clean power. The drawback of this wonderful little regulator is that it is very small - it cannot dissipate heat very well. This means that while it can handle voltages up to 16v anything over 7v it can get so hot that it resets ... some people are planning to use these in 12v applications, such as cars - we've decided to offer a super cheap, easy to use, 5v step down regulator module. It will take a screw terminal input voltage up to 22v and output 5v into a USB connector
 
You are absolutely right. The Teensy, LED display and SD reader take 85ma. :( Shows you how much I know about Ohm's Law. I thought about a buck converter, but I wanted to keep the footprint small. I may have to do that anyway. Thanks for your feedback.

Drew

With a 13 V input and 5 V output, 85 mA will only cause 0.085*(13-5) = 680 mW dissipation in the 7805. It should be able to do that with a small heatsink, especially if you put it in (inside !) a metal box (not a plastic one).
 
DC/DC Converter Ordered

GremlinWrangler;

Thank you for the links. Last week I ordered a buck converter from another vendor. Fortunately the order did not go through. This morning I read your post. I already have a number of products from Adafruit… and I am pleased with them. For that reason, I ordered the Mini DC/DC Step-Down (Buck) Converter - 5V as you suggested. Thank you for that.

Jp3141;

As mentioned in my above post, I machined a small heat-sink, but it is still very hot to the touch. While I do have insurance on my boat, I’m not sure that I could explain why it burned up because I put a DIY project on board. :) I am including a picture of the heat-sink. I thought it would be more than adequate to dissipate the heat, but not so. Whatever I do I will definitely machine an aluminum box with thermal insulator standoffs. I am going to see if GremlinWrangler’s suggestion works. If not, I will figure it out from there.
While I was reading this post, it came to me that I should modify my program to monitor and record the heat inside the box and on the DC/DC converter and alert me if it gets too high.

Thank you all so much for your input.

Drew

DSCF4271.jpgDSCF4273.jpg
 
GremlinWrangler;

The "Mini DC/DC Step-Down (Buck) Converter - 5V" as you suggested works perfectly. Not only that, but current draw for my whole project was cut from 85ma to 35ma and the Buck is cool to the touch... and that's with 14.5V applied. Moreover, it's a much smaller footprint. Great suggestion. Thanks.

Drew

DSCF4277.jpgDSCF4278.jpg
 
I am not sure if it would help, but on some of my boards, which I have done for my own fun, I have used some of these DC to DC converters: http://www.digikey.com/product-search/en?keywords=811-3014-ND

I Have used both the 3.3v and 5v versions. With 5vs I have also used the vertical version of these as well. I found out about these as they are what Trossen Robotics uses in their Arbotix-m and Arbotix Pro boards, which are setup to typically run off of 3s and 4s lipo batteries.
 
Kurt,

Looks like a good alternative @ 1/3 the price. I will pick some up and see how they compare. Thanks for the link.

Drew
 
Status
Not open for further replies.
Back
Top