Supply power to circuit only when person is near

Hi,
I have some simple audio circuits that makes some blips and blops outputted to a 8ohm speaker and powered with a 9V 3W solar panel.
this circuit is constantly output sound at day light. I would like to make a circuit using Arduino that will connect and disconnect the solar panel to the audio circuit based upon if someone is close to the circuit. So only when a person in approaching the audio circuit the solar panel will powered the circuit and sound will be outputted. otherwise - no sound

I guess I should use a logic level MOSFET to open and close the path from the solar panel to the vcc of my audio circuit. The question I have is:

  1. what sensor I should use? assuming I would like the circuit will be ON whenever a person is approaching of around 50-100 cm distance.
  2. powering the Arduino - Could it also be powered by the 9V 3W solar panel?

Thanks for any guidance!

At that distance, plug it in when you arrive.

But it should be ON only when a person is getting close. maybe I should think about bigger distance? perhaps using something like pir sensor?

Can I use this sensor also without an arduino? how can I make sure the ON time will be at least 10 seconds since a person was ditched by the sensor? using a 555 timer? or better to use Arduino for that?

So I made the following schematics:

The area marked in red is the solar panel and the area marked in green is the audio circuit.
I would like that whenever the sensor SR505 is ON it will trigger the 555 monostable and that in return will output a HIGH signal of around 10 senods via pin 3.
That HIGH signal should connect the audio circuit VCC on and off so only when a person is detect by the sensor the audio circuit will output sound.
I'm not sure how I should wire it. Any help?

Thanks!

I might need to connect the vcc pin of the 40106 (pin 14) to the Source of the MOSFET and the VCC of the solar panel to the Drain of the MOSFET?
So whenever the MOSFET gate is HIGH it will made a connection between the audio circuit VCC and the Solar Panel VCC ?

I don't know if the N-channel mosfet will work to switch the high-side audio power. When it turns on, the voltage at the source will rise, which reduces G/S voltage. So it will tend to turn itself off.

But the N-channel should work fine if you use it to switch the audio ground.

Like that?

I guess I see it as all the "ground" points in the audio circuit being switched through the mosfet to the main circuit and panel ground.

So lets see if I understand it right -
All audio circuit grounds are connected to the MOSFET Source. (I marked then in orange)
The solar ground (the main ground) is connected to the MOSFET Drain.
When MOSFET Gate is HIGH a connection between Drain and Source is made and therfore Audio circuit is indeed connected to the main ground and current can flow and sound will be heard ?

No I have a question regarding the 555 timer.
I choose 100uF for the cap and 100k for the resistor. a HIGH signal pulse of about 11 seconds should be presented at pin 3. The Gate of the MOSFET should therefore to be open for that time and audio will be heard for that time.

What happen if a person is in the area of the sensor more then 11 seconds? the output of the 555 timer will continue to be HIGH?

what I try to achieve is kind of if statement:

if (sensor == HIGH && sensor HIGH Time < 11 sec)
{
555 timer HIGH for 11 sec
}
else if (sensor == HIGH && sensor HIGH Time > 11 sec)
{
555 timer HIGH == sensor HIGH Time
}

Is the above possible?

So I have checked the 555 timer in FastLad simulator:
link

it seems that indeed it will output a HIGH pulse same as I wanted.
The problem is that the 555 timer is need a LOW at the input pin while the 505 sensor is outputting HIGH signal when a person is detect. How can I inverse the state of the sensor output?

edit:
Here is my solution using npn transistor to invert the input signal. Any comments?

Hi,

If you read the data sheet on the LM555 it triggers on a NEGATIVE going edge.
lm555.pdf (1.1 MB)

I used to use a capacitor in series with the trigger input (2) and have the trigger input (2) pulled to gnd with something like 10K to 47K.
Try 0.01uF, but you may have to experiment, I had the advantage of a scope.

The cap would cause a spike, from a square pulse, to appear at the trigger, the negative going edge would trigger the 555.

That way only output transitions would be sent to the 555 trigger.

Tom.. :smiley: :+1: :coffee: :australia:

So my latest schematics I posted should work no? the transistor invert the input signal from the sensor.
o you mean I should add a capacitor in series with the trigger input in addition to my design using the npn transistor?

Yes, and a high value capacitor between pin 2 nd gnd, it may work in your project, its worth trying.

Tom.. :smiley: :+1: :coffee: :australia:
PS. I'm off to get dinner, back later.

I have added a capacitor in series between the transistor collector lug and pin 2 of the 555. I also added a capacitor between pin 2 to gnd.
It seems not to work.
I think the capacitor between the collector and pin 2 is blocking the dc current isn't it?
link to circuit

Use a resistor as I recommended, the capacitor does remove the DC, but only allows the changing current through which is what triggers the LM555.

I hope you have still left the 10K between Q1 collector and Vcc.
What value capacitor did you use in series with the Q1 collector to LM555 trigger pin?

Tom... :smiley: :+1: :coffee: :australia:

is this schematic the correct way?

I did not yet try it in real world. I only Fastlad simulate it and it seems not to work with the series capacitor between collector and pin 2 of 555. If I remove the cap and connecting the collector to pin 2 it is working. Why the cap is needed?

Is this not suitable?

Hi,
The circuit with C11 in circuit should work.
Forget simulations and build a prototype.

You can try both versions if you build it.
Just put an LED and series resistor on pin 3 of the LM555 to gnd, just to show its output state.

Tom.. :smiley: :+1: :coffee: :australia:

1 Like

No. The audio circuit grounds should be connected to the mosfet Drain. The main ground should be connected to the Source.

By the way, the symbol you are using for the FQP mosfet is a P-channel symbol. The FQP is N-channel.

What the difference those it make?