Using a 5V sensor with battery powered Photon

Hello Hardware experts,

I’m planing to build a (LiPo) battery powered ultrasonic sensor project controlled by one of my Photons.
The challenge here is, the ultrasonic sensor (HC-SR04) requires 5 volts. I testet it with an USB powered Photon which work fine.

But the final project will have the Photon is powered by a Sparkfun battery shield. Measurements taken once an hour, the rest of the time the Photon is going to deep sleep.

My questions is about the options, best practices to power the sensor with 5 volts. Especially in combination with only 3.7 volts from the LiPo and with the goal of maximum energy efficiency. If the Photon is in deep sleep the sensor should be without power to conserve energy.

Currently I have the following idea, but not sure if they might work at all:

  1. use a 5V Step-Up module (like https://www.sparkfun.com/products/10968) connected to the 3.3 Vout of the Photon power the sensor
  2. use a 5V Step-Up module (like https://www.sparkfun.com/products/10968) connected to one of the Dx pins of the Photon and set that to HIGH to have full control about the sensor power
  3. Power the sensor with a separated battery (4 Eneloop AA can give 4.8 volts) and use a relay to switch power on / off
  4. Power the entire system Photon & sensor by 4 Eneloop AA batteries
  5. Power the entire system Photon & sensor by USB Powerpack

Are the other options as well? Any help is appreciated.

Thx
Markus

1&2) The chip used in that sparkfun product have a enable pin, but its not broken out, if you can get access to it with some soldering/custom board, you can get the best of both options.
Connecting it directly to a pin may work, but it may also draw too much current when starting up, someone else may be able to calculate that.

  1. Some USB powerbanks requires a button press to start charging and disconnects the load if it drops below a few mA, so that could be a concern with deep sleep.
1 Like

@mhdevx, you could also consider these Pololu SMPS units which have “shutdown” pins:

:smile:

1 Like

Thx. I just found https://www.wirelessthings.net/powerpod-ncp1402-5v0 which looks very similar to https://www.pololu.com/product/2562.

@mhdevx, the Photon can peak at 140-150ma when connecting to wifi. You may want to consider a supply which can provide more current and operate within its high efficiency range. This is why I recommended the Pololu devices. The board you found can only supply 120ma and only has a voltage input range of 1.0 - 3.0 volts. The Pololu has a range of 0.5 - 5.5 volts giving you more supply options (3 vs 2 batteries or a LiPo for example) whereas the PowerPOD cannot. :smile:

2 Likes

Thx @peekay123 I will go for the Pololu. And it is even cheaper then the PowerPOD :wink:

1 Like

Hi @mhdevx, Did you end up connecting the pololu step-up converter to the Vout of the photon? I want to do a similar thing using the sparkfun battery shield but need to power a micro servo.

@stoobee, the boost converter goes to Vin (5V) of the Photon! It needs to be powered directly from the battery or batteries due to the current limitation of the Photon’s regulator. I believe this is how @mhdevx did it. :grinning:

@peekay123 Great, thanks!

1 Like

@stoobee, @peekay123 I use a Sparkfun battery shield as well. As @peekay123 describes I only use the converter to power the ultrasonic sensor.

2 Likes

@mhdevx, has that setup been working for you? I’ve been trying the same setup with the pololu circuit powering just the sensor, and I’m getting a huge drop in the max range of the sensor, as well as some weird readings even within the range.

Yes it works very well. Are you sure your ultrasonic sensor gets really 5V? The drop in max range and shaky unsteady readings sounds like the symptoms I had if the sensor was powered with 3.3 V only.

It seems to be getting 5V measured by my multimeter. and when I hook-up the ultrasonic sensor to the 3.3V source I get essentially zero for readings.

I read in the comments on this page, about some problems with the range and false reflections.

Your amplitude will decrease and so will your range. You'll have to check the datasheet for MAX232 and for the chinese uP to see how low can you go. If you use a step-up regulator unless you have very good filtering and decoupling the switching noise will probably get amplified and give you false reflections. A better choice would be to use 3 or ever 4 AA batteries instead.

You aren't experiencing this at all?

4 posts were merged into an existing topic: Powering Electron & ADS 1231 / load cell (5V) with Sunny Buddy (Solar & LiPo)

@mhdevx or @samlroberts Would you mind posting a fritzing or circuit diagram for your setup? Or even a rough sketch would be great so I’m not making any mistakes.