Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIR to Arduino and LEDs #2

Status
Not open for further replies.
Hello eTech and the ETO forum,



Response to post #18:



The PC layout software is Dip Trace by Novarm

Link to Dip Trace home page

It does have a Schematic Capture module.

An attempt to master the Schematic Capture

feature was attempted but was abandoned in the face of a steep

learning curve. But now that a comfort level

has been achieved with the PCB Layout domain

will look at using the Schematic Capture.

I can see, not only would it save time, but solve

issues at several levels in going from schematic to PCB.



Will repost all three module schematics and

PCBs.

I recommend that you DO NOT post any more schematics, boards or order PCB's at this time. It is becoming difficult to keep track of them.

I suggest you take time to learn the schematic capture and capture the schematics first.

Then we can review the captured schematics, check they are up to date and correct before proceeding to PCB layout. This is what I was alluding to when suggesting to make ONE schematic and keep it up to date. Let the schematic drive the board layout. Also, the parts used on the boards posted seem to be of random package type/size. For example, the sensor module should have all 1/4 resistors and Q1 should be a TO-92 case. A list of parts should be on hand to use for laying out the board and ordering parts.

I make these suggestions because I want you to succeed with your project (It is a cool project) :).

Have had some years of element versioning
working with software. It may be noticed
that the drawings are always dated and some have
revision notes like POCADAL Sensor Module
View attachment 127694
dated 200725 revised in Aug and Oct.
Although it is admitted sometimes revisions
are not always noted and will double down
on that.

Your post above has not been updated.

Response to post #19:

Will post separate LED, Sensor and
Shield schematic and PCBs as soon as able.
I believe this is the latest over all schematic.
View attachment 127695
Was there another schematic of the complete
system posted? It was thought that this
is the latest.

It looks close but I cannot vouch for the above schematic. I can only post the schematic I have and I know to be correct. The only thing that has changed in mine is the annotations we discussed in post #10.

The bread board was
examined and there is a red/red/orange
resistor. But i guess it was eliminated
and the elimination was missed.

It was never there and must have gotten added by mistake.

Oh, wait a minute. Separate 22k resistors
are shown for each of the sensor inputs
on schematic marked 'REF: 202026 Rev 2020/1028'.
They are marked R1, R2, R3, R4, R5, R6, R15, R25.
So in preparation for refactoring the
Shield Main Board would just run through
some of the ideas about how the Sensors
connect to the Main Board Shield and the
Arduino underneath. (It is realized that
pins from the shield penetrate down from the shield
to the Arduino for inputs on the left and
for outputs from the Arduino to the
DMOS array IC on the right. Right?)

I took your FTB designator to be whatever you are using to make a connection from the arduino pins to the shield. The terminal shown as a box with an "X" inside is a typical symbol for an arduino terminal and represents an "FTB" connection. I called it a "Feed Thru Terminal". I can see now that that is probably not a good designator as you meant FTB to mean "Fixed Terminal Block". TB1 through TB12 are Fixed Terminal Blocks.

1. The wires (some of them several feet long)
go from the two position fixed terminal blocks
(FTBs) on the Sensor modules and are received by
two position FTBs on the Shield marked
'IN S1 RTN' thru 'IN S8 RTN' on schematic
marked 'REF: 202026 Rev 2020/1028'.

Correct.

2. The 'IN S1 RTN' FTBs go to sixteen 430 ohm
resistors and to the anode and cathode of the
optocouplers. The emitters of the optocouplers
go to ground. The optocoupler collectors
go first, via traces on the shield, to the
Arduino input pins, and second to a 22k
resistor and then to the plus five volt
pin of the Uno.

This is the only part that made me scratch my
head. 'REF: 202026 Rev 2020/1028' shows what
is designed on the shield to be header pins
going thru shield down to the Arduino as
FTB1 and FTB2 (FTBs?)
Beginning to think this just how the headers
are marked based on the mistake I made in the PCB
marked 'POCADAL Arduino Shield Maon(sic) 201024
in post #17. That is, an extra set of FTBs were
shown because I forgot to remove
the FTBs from the shield when the optocouplers
were moved to the shield.

This is probably the same reason why the six input pins
sticking down thru the shield to pins A0-A5
on the Arduino are marked FTB3. My bad.

Review schematic post #19,

I took your FTB designator to be whatever you are using to make a connection from the arduino pins to the shield. The terminal shown as a box with an "X" inside is a typical symbol for an arduino terminal and represents an "FTB" connection. I called it a "Feed Thru Terminal". I can see now that that is probably not a good designator as you meant FTB to mean "Fixed Terminal Block". TB1 through TB12 are Fixed Terminal Blocks.

Ok I get it. The big difference between
'REF: 202026 Rev 2020/1028' and the two
drawings in post #17 ('POCADAL...201024'
and 'POCADAL...201026) is my drawing
shows one 22k resistor and eTech's shows
eight 22k resistors.

Will

1. Post the latest schematics and PCB
drawing of the LED and Sensor modules.

2. Redraw the shield PCB drawing based on
'REF: 202026 Rev 2020/1028' and post.

Glad I got your input before I ordered
the shield PCB.

Thanks.

Allen in Dallas
PS Sorry about the length of this post

but I think it got us on the same path.

I suggest, once more, to take some time to learn the schematic capture program and practice passing changes between the schematic and board layout so you get a feel of what is required for updates to work. You can create a simple one LED board to try this on. Practice this until you are comfortable with it. Then capture the sensor module schematic and we'll start from there.
 
Last edited:
Hello ETO forum,

It has taken me a while to get my head wrapped around
Dip Trace schematic software as suggested by the experienced
eTech in the Oct 27 post #18 to forum thread

And the point made in that post was well taken:

I need to organize the info, the schematics and PCB drawings.

So the focus of this re-entry is two things:
1. Offer a more organized list of docs.
2. Ask a question about the original 12v schematic
(The schematic design as not changed since early Sept 2019.
[There was an early schematic in Aug 2019 that used a 5v power supply
that was abandoned in favor of a 12v source.])

There are three modules:
- The Main board - Ardunio Shield called the 'Shield' hereafter
- The Sensor Module, includes the PIR
- The LED Module, pretty simple two resistors, six LEDs

As eTech suggested there would be two representations of each
of the three modules, a schematic and a PCB illustration.
So that's six depictions. But then a schematic is needed to
show the whole, complete system which is seven. And a couple
are needed to explain aspects of the design. So an attempt
is made to keep the number to a minimum but ten is about the
minimum needed. It is a large system stretching out about
fifteen feet.

Rather than display them all in this post a zip file has been created with
these docs.
1. The complete schematic: Shows one PIR and mainboard connection.
PODACAL_12v_complete_200907.jpg (Titled: 'Pocadal...' dated 201812)
2. Shield schematic: shows schematic of PCB that mounts on Arduino
PODACAL_12v_main_board_201029.gif
3. Shield PCB
Staircase_Main_Board_PCB_201128.jpg
4. Sensor Module schematic: PIR and transistor
PODACAL_12v_Sensor_mod_schematic_201023.jpg
5. Sensor module PCB
Sensor_Mod_201020_PCB.jpg
LED Module schematic no separate drawing because shown on
PODACAL_12v_main_board_201029.gif
6. LED Module PCB
LED_Mod_200910_PCB.jpg

Ancillary drawings
7. The Staircase design: shows placement and number of modules.
Why, for instance, there are three LED modules at first and last
and two modules for each in between: Sixteen LED modules one for each
stair riser: two for the five intermediate (2 -6) is ten and three for
first and last is six. Ten and six make sixteen.
staircase_design_200528_600_x_400.gif
8. Staircase Module Locations shows map of Sensor modules (8) and
LED Modules (16) and wiring to Shield and power
Module_location_drawing_201220_800_x_600.gif
9. Main board schematic: how the Shield and the opto-couplers
work with TBD62003A. Similar to Shield schematic.
PODACAL_12v_Arduino_Shield_Main_Board_schematic_201026.jpg
10. How the Shield fits on the Arduino
Arduino_shield_for_TBD620033A_201212.jpg

Don't get me wrong. It is not expected that anyone
will look at all these docs. Just wanted to get a baseline
on the project docs. Hope were coming into the
home stretch and they won't change much. So in
future posts perhaps these docs can act as reference.

And the final question. In the complete schematic
file name PODACAL_12v_complete_200907.jpg
which will be posted here in the post, so it doesn't have to be dug out of the zip file,
in the wires between the sensor module and opto_coupler, the
wires are marked 'PIR1 out' and 'PIR1 rtn'.

PODACAL_12v_complete_200907.jpg


The 'PIR1 out' is understood. This the signal
going out from the sensor to the opto-coupler
and the Shield.

But (assuming that 'rtn' is 'return' at 'PIR1 rtn') what is
being returned? The trace marked 'PIR1 rtn' is going to
the collector of the 2N3904 so don't understand
how and why something is being returned to a transistor
collector.

Thanks.

Allen in Dallas
 

Attachments

  • Staircase_docs_201220.zip
    937.9 KB · Views: 199
what is
being returned? The trace marked 'PIR1 rtn' is going to
the collector of the 2N3904 so don't understand
how and why something is being returned to a transistor
collector.
It's a "Current loop" driver. The transistor switches on or off current (set by the resistors) to the LED in the opto isolator.
The labelling does not change how it works.
From the LED half "point of view", you could say it has a + supply and - return, while the transistor is on..

It's virtually a clone of a standard current loop as used for MIDI instrument interfaces.

See the schematics on this page as an example - they are split between the driver and receiver as it's a plug-together system, but if you look at the two haves together it's pretty much the same setup as in your drawing.

 
I still don't understand why there are four 430Ω resistors in series with the opto LED.

Mike.
 
Hello ETO forum,

It has taken me a while to get my head wrapped around
Dip Trace schematic software as suggested by the experienced
eTech in the Oct 27 post #18 to forum thread
May be a little late in the game but I ask these questions because if the schematic was captured with the software, then design changes could be sent back and forth between the schematic and board layout to keep them synchronized, making change management a lot easier. If you make a mistake, you could make the correction in one process and easily pass the changes to the other process.

As a suggestion,
Make one schematic of each module. This will be used as a main copy.
Make one board layout for each module. This will be used as a main copy. .....

And the point made in that post was well taken:

I need to organize the info, the schematics and PCB drawings.

So the focus of this reentry is two things:
1. Offer a more organized list of docs.
2. Ask a question about the original 12v schematic
(The schematic design has not changed since early Sept 2019.
[There was an early schematic in Aug 2019 that used a 5v power supply
that was abandoned in favor of a 12v source.])

There are three modules:
- The Main board - Arduino Shield, called the Shield hereafter
- The Sensor Module, includes the PIR
- The LED Module, pretty simple two resistors, six LEDs

As eTech suggested there could be two representations of each
of the three modules, a schematic and a PCB illustration.
So that's six depictions. But then a schematic is needed to
show the whole, complete system which is seven. And a couple
are needed to explain other aspects of the design. So an attempt
is made to keep the number to a minimum but ten is about the
least needed. It is a large system stretching out about
fifteen feet.

Rather than display them all in this post a zip file has been created with
these docs.
1. The complete schematic: Shows one PIR and mainboard connection.
PODACAL_12v_complete_200907.jpg (Titled: 'Pocadal...' dated 201812)
2. Shield schematic: shows schematic of PCB that mounts on Arduino
PODACAL_12v_main_board_201029.gif
3. Shield PCB
Staircase_Main_Board_PCB_201128.jpg
4. Sensor Module schematic: PIR and transistor
PODACAL_12v_Sensor_mod_schematic_201023.jpg
5. Sensor module PCB
Sensor_Mod_201020_PCB.jpg
LED Module schematic no separate drawing because shown on
PODACAL_12v_main_board_201029.gif
6. LED Module PCB
LED_Mod_200910_PCB.jpg

Ancillary drawings
7. The Staircase design: shows placement and number of modules.
Why, for instance, there are three LED modules at first and last
and two modules for each in between: Sixteen LED modules one for each
stair riser: two for the five intermediate (2 -6) is ten and three for
first and last is six. Ten and six make sixteen.
staircase_design_200528_600_x_400.gif
8. Staircase Module Locations shows a map of Sensor modules (8) and
LED Modules (16) and wiring to Shield and power.
Module_location_drawing_201220_800_x_600.gif
9. Main board schematic: how the Shield and the opto-couplers
work with TBD62003A. Similar to Shield schematic.
PODACAL_12v_Arduino_Shield_Main_Board_schematic_201026.jpg
10. How the Shield fits on the Arduino
Arduino_shield_for_TBD620033A_201212.jpg

Don't get me wrong. It is not expected that anyone
will look at all these docs. Just wanted to get a baseline
on the project docs. Hoping we are coming into the
home stretch and they won't change much. So in
future posts perhaps these docs can act as reference.

Have received the PCBs and am loading the boards
to do a PIR to Shield to LED module test.

And the final question.
In the complete schematic
file name PODACAL_12v_complete_200907.jpg
which will be posted here, so it doesn't
have to be dug out of the zip file.
PODACAL_12v_complete_200907.jpg


On the traces between sensor module and opto_coupler the
wires are marked in green font: 'PIR1 out' and 'PIR1 rtn'.
(Just above blue font:
'H=12.0=Motion
L=0.0v= No Motion'

The 'PIR1 out' is understood. This the signal
going out from the sensor to the opto-coupler
and the Shield.

But (assuming that 'rtn' means 'return' at 'PIR1 rtn') what is
being returned? The trace marked 'PIR1 rtn' is going to
the collector of the 2N3904 so it is not understood
how or why something is being returned to a transistor
collector.

Thanks.

Allen in Dallas
 

Attachments

  • Staircase_docs_201220.zip
    2 MB · Views: 189
Hello ETO forum,

Got the boards for the staircase project loaded and connected
using the tested schematic:
PODACAL_12v_complete_200907.jpg


Here's a photo:
Sstaircase_test_201227_b_600_x_450.jpg


Test one PIR to Arduino and LED DMOs
1a. Connected sensor S1 to 12v and grnd.
1b. Connected sensor S1 to Out and Rtn at Arduino shield.
1c. Connected LED module ground to DMOS connx LM1 and
+12v at power source.

Expected result: LED modules light w motion at the PIR
Actual result: LED modules do not light with motion at the PIR

Have tried connecting the LED +V to the +v on the Arduino. No luck.
Also unit tested the LED modules and the Sensor module.
See PIR Sensor Unit Test posted herewith below.

Also posted below PIR_to_Arduino_sketch

Thanks.

Allen in Dallas

PIR Sensor Unit Test (eTech)
Post # 8 'PIR to Arduino and LEDs #2'
20 Oct 2020
1. Connect a temporary jumper from +PIR out to PIR Rtn.
2. Connect the DMM +probe to either the temporary jumper, or the +PIR out terminal. (make sure the jumper is in place)
3. Connect the DMM ground probe to -PWR
4. Connect 12 vdc power to the +PWR and -PWR terminals.
5. The DMM should read about 12 vdc with no motion detected (doesn't need to be exact).
6. Cause motion to be detected by the PIR (a wave of a hand over the PIR).
7. The DMM should read less than 0.7 vdc with motion detected (doesn't need to be exact).

++++++++PIR to Arduino Sketch +++++++++++
Code:
int led = A0;               // the pin that the sensor is attached to
int sensor = 2;         // the pin that the sensor is attached to

void setup() {
  pinMode(led, OUTPUT);
  pinMode(sensor, INPUT);
  Serial.begin(9600);
}

void loop() {
  int sensorval = digitalRead(sensor);
  Serial.println(sensorval);
 
if (sensorval == LOW) {
    digitalWrite(led, HIGH);
  }else{
    digitalWrite(led, LOW);
  }
 
}
 
Hello ETO forum,

Got the boards for the staircase project loaded and connected
using the tested schematic:
View attachment 128710

Here's a photo:
View attachment 128714

Test one PIR to Arduino and LED DMOs
1a. Connected sensor S1 to 12v and grnd.
1b. Connected sensor S1 to Out and Rtn at Arduino shield.
1c. Connected LED module ground to DMOS connx LM1 and
+12v at power source.

Expected result: LED modules light w motion at the PIR
Actual result: LED modules do not light with motion at the PIR

Have tried connecting the LED +V to the +v on the Arduino. No luck.
Also unit tested the LED modules and the Sensor module.
See PIR Sensor Unit Test posted herewith below.

Also posted below PIR_to_Arduino_sketch

Thanks.

Allen in Dallas

PIR Sensor Unit Test (eTech)
Post # 8 'PIR to Arduino and LEDs #2'
20 Oct 2020
1. Connect a temporary jumper from +PIR out to PIR Rtn.
2. Connect the DMM +probe to either the temporary jumper, or the +PIR out terminal. (make sure the jumper is in place)
3. Connect the DMM ground probe to -PWR
4. Connect 12 vdc power to the +PWR and -PWR terminals.
5. The DMM should read about 12 vdc with no motion detected (doesn't need to be exact).
6. Cause motion to be detected by the PIR (a wave of a hand over the PIR).
7. The DMM should read less than 0.7 vdc with motion detected (doesn't need to be exact).

++++++++PIR to Arduino Sketch +++++++++++
Code:
int led = A0;               // the pin that the sensor is attached to
int sensor = 2;         // the pin that the sensor is attached to

void setup() {
  pinMode(led, OUTPUT);
  pinMode(sensor, INPUT);
  Serial.begin(9600);
}

void loop() {
  int sensorval = digitalRead(sensor);
  Serial.println(sensorval);

if (sensorval == LOW) {
    digitalWrite(led, HIGH);
  }else{
    digitalWrite(led, LOW);
  }

}


My first suggestion is to test each module independently identify and localize the problem.
 
That "PIR test" was presumably from an earlier design, as you cannot possibly get the result it states - so also, presumably, you have not actually tested the PIR modules on their own?

Link PIR OUT and PIR RTN

With power applied, the voltage on that link should be around supply voltage with no trigger and half supply when triggered.

The two 470 resistors form a divider, so the transistor turning on (and collector near 0V) means half way between that and supply at the output, while the jumper link is in place.

If connected to the opto on the next board, the PIR OUT voltage should drop slightly, a couple of volts or so, and the PIR RTN voltage drop rather more, down to 2 - 3V, when triggered.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top