Production line stop alarm

From uCtrl
This page is kept for historical interest. It may document projects or methods that are obsolete and/or no longer relevant. The information here is not kept up-to-date.

I built this module for Sensonor ASA back in 2004, I have no idea if it is alive today.
Production stop alarm

Information

This units gives a one second signal if an input is triggered. Every input has separate timers that counts for seven seconds after the input signal has ceased. A new signal within these seven seconds will not result in a new alarm.

I/O

Inputs

  1. PB.0 (pin 12)
  2. PB.1 (pin 13)
  3. PB.2 (pin 14)
  4. PB.3 (pin 15)
  5. PB.4 (pin 16)
  6. PB.5 (pin 17)
  7. PB.6 (pin 18)
  8. PB.7 (pin 19)

Outputs

  1. PD.4 (pin 8)

Schematic drawing

Production-line-stop-alarm-circuit-r4dwzg.png

Parts list

Qty. Part
1 AVR AT90S2313-10PI, DIL-20, 10 MHz, 15 I/Os
1 Capacitor, aluminium electrolytic, 10 µF, 25V
2 Capacitor, aluminium electrolytic, 47 µF, 25V
2 Capacitor, ceramic, 22 pF, 100V
1 Capacitor, ceramic, 1 nF, 100V
1 DIL socket, 20-pin, 7.62mm
8 Optocoupler, single, CNY17F-3, DIL-6
64 cm2 PCB, stripboard, 100x160mm, 160cm2
1 Quartz crystal oscillator, 4 MHz
8 Resistor, carbon film, 0.25W, 330 Ω, 5%
2 Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
8 Resistor, carbon film, 0.25W, 10 kΩ, 5%
8 Resistor, metal film, 0.6W, 2.2 kΩ, 1%
1 Switch, push-button, PCB, 1-pole, H4.3mm, vertical, black
1 Transistor, NPN, 100 mA, 45V, 0.5W, BC547B
1 Voltage regulator +5V, 2 A, L78S05CV

Source code

Template:Basic code

'--------------------------------------------------------------
' Thomas Jensen
'--------------------------------------------------------------
' file: SENSONOR.BAS
' date: 30/01/2004
'--------------------------------------------------------------

$crystal = 4000000
$baud = 9600
Config Portd = Output
Config Portb = Input
Dim Inn1 As Integer
Dim Inn2 As Integer
Dim Inn3 As Integer
Dim Inn4 As Integer
Dim Inn5 As Integer
Dim Inn6 As Integer
Dim Inn7 As Integer
Dim Inn8 As Integer
Inn1 = 0
Inn2 = 0
Inn3 = 0
Inn4 = 0
Inn5 = 0
Inn6 = 0
Inn7 = 0
Inn8 = 0
Portd.4 = 1
Waitms 500
Portd = 0

Main:
If Pinb.0 = 1 And Inn1 = 0 Then
   Portd.4 = 1
   Inn1 = 70
   Waitms 1000
   Portd.4 = 0
   End If
If Pinb.1 = 1 And Inn2 = 0 Then
   Portd.4 = 1
   Inn2 = 70
   Waitms 1000
   Portd.4 = 0
   End If
If Pinb.2 = 1 And Inn3 = 0 Then
   Portd.4 = 1
   Inn3 = 70
   Waitms 1000
   Portd.4 = 0
   End If
If Pinb.3 = 1 And Inn4 = 0 Then
   Portd.4 = 1
   Inn4 = 70
   Waitms 1000
   Portd.4 = 0
   End If
If Pinb.4 = 1 And Inn5 = 0 Then
   Portd.4 = 1
   Inn5 = 70
   Waitms 1000
   Portd.4 = 0
   End If
If Pinb.5 = 1 And Inn6 = 0 Then
   Portd.4 = 1
   Inn6 = 70
   Waitms 1000
   Portd.4 = 0
   End If
If Pinb.6 = 1 And Inn7 = 0 Then
   Portd.4 = 1
   Inn7 = 70
   Waitms 1000
   Portd.4 = 0
   End If
If Pinb.7 = 1 And Inn8 = 0 Then
   Portd.4 = 1
   Inn8 = 70
   Waitms 1000
   Portd.4 = 0
   End If
If Pinb.0 = 1 Then Inn1 = 70
If Pinb.1 = 1 Then Inn2 = 70
If Pinb.2 = 1 Then Inn3 = 70
If Pinb.3 = 1 Then Inn4 = 70
If Pinb.4 = 1 Then Inn5 = 70
If Pinb.5 = 1 Then Inn6 = 70
If Pinb.6 = 1 Then Inn7 = 70
If Pinb.7 = 1 Then Inn8 = 70
If Inn1 > 0 Then Inn1 = Inn1 - 1
If Inn2 > 0 Then Inn2 = Inn2 - 1
If Inn3 > 0 Then Inn3 = Inn3 - 1
If Inn4 > 0 Then Inn4 = Inn4 - 1
If Inn5 > 0 Then Inn5 = Inn5 - 1
If Inn6 > 0 Then Inn6 = Inn6 - 1
If Inn7 > 0 Then Inn7 = Inn7 - 1
If Inn8 > 0 Then Inn8 = Inn8 - 1
Waitms 100
Goto Main
End