Temperature and light sensor with signalling LEDs (RS232)

From CaveLab
This page is currently a draft. Please check back later for additional changes.
Temperature and light sensor with signalling LEDs

I/O

Inputs

  • PC0 Temperature sensor (analog)
  • PC1 Light sensor (analog)
  • PC2 Analog input 3
  • PC3 Analog input 4
  • PC4 Analog input 5
  • PC5 Analog input 6

Calculations

Temperature
Light intensity

Outputs

  • PB0 Buzzer
  • PB1 Green LED (PWM)
  • PB2 Yellow LED (PWM)
  • PB3 Red LED (PWM)
  • PD3 Life signal
  • PD4 Link activity

Serial communication

  • PD0 Rx
  • PD1 Tx

D-sub 25-pin

  1. 13.8V
  2. 0V
  3. 5V out (from internal voltage regulator)
  4. 0V out
  5. Analog input 3
  6. Analog input 4
  7. Analog input 5
  8. Analog input 6

Communication

Interfacing is done with RS-232, using MAX232 or MAX202.

Serial settings

Baud
38400
Data bits
8
Parity
None
Stop bits
1

Source code

Git-alt-brands.svg
Bascom-AVR source is available in a git repository:
https://github.com/thomasjsn/AVR-Temp-light-sensor-LED-signals-RS232

Gallery

Schematic drawing

AVR temperature light sensor LEDs circuit.png

Parts used

Qty. Part
1 × AVR ATmega8-16PU, DIL-28, 16 MHz, 23 I/Os
1 × Buzzer, electromagnetic PCB, 12V, 35mA, Ø16mm, int. oscillator
5 × Capacitor, aluminium electrolytic, 1 µF, 50V
2 × Capacitor, aluminium electrolytic, 10 µF, 25V
3 × Capacitor, aluminium electrolytic, 47 µF, 25V
1 × Capacitor, ceramic, 1 nF, 100V
3 × Capacitor, metallized polyester foil, 10 nF, (0.01 µF)
1 × D-sub soldering cups, 25 pin male
1 × D-sub soldering cups, 9 pin female
1 × DIL socket, 16-pin, 7.62mm
1 × DIL socket, 28-pin, 7.62mm
1 × Enclosure, plastic (1591 FL), 150x80x50mm, flange
1 × Fuse 5x20 mm, 800 mA, fast-acting
1 × Fuse holder, panel, 5x20mm, PTF30
1 × Heatsink, 27.3K/W, 19mm, attachable, TO220
1 × LED 5mm clear, Green, 2.1V, 20mA, 385mcd, 6°
1 × LED 5mm clear, Green, 3.4V, 20mA, 10.000mcd, 25°
1 × LED 5mm clear, Red, 2.1V, 20mA, 7.000mcd, 20°
1 × LED 5mm clear, Yellow, 2.0V, 20mA, 250mcd, 6°
1 × LED 5mm clear, Yellow, 2.1V, 20mA, 10.000mcd, 20°
1 × LED lens 5mm, CLB 300 low, Green
1 × LED lens 5mm, CLB 300 low, Yellow
1 × LED lens 5mm, CLF 280, Green
1 × LED lens 5mm, CLF 280, Red
1 × LED lens 5mm, CLF 280, Yellow
1 × Light-to-voltage sensor, TSL 252R, 9.4mV / (μW/cm2)
64 cm2 PCB, stripboard, 100x160mm, 160cm2
1 × Power jack, panel, 2.1mm, plastic housing
1 × Resistor, carbon film, 0.25W, 100 Ω, 5%
2 × Resistor, carbon film, 0.25W, 150 Ω, 5%
2 × Resistor, carbon film, 0.25W, 330 Ω, 5%
2 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
1 × RS232 interface, MAX232CPE, dual
1 × Spacer, round unthreaded, 3mm, Ø6mm, Delrin
35 × Straight pin header, female, Single row, 2.54mm
2 × Straight pin header, male, Dual row, 2.54mm
40 × Straight pin header, male, Single row, 2.54mm
1 × Temperature sensor LM35DZ, 0 to +100 °C, +-0,6 °C
1 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B
1 × Voltage regulator +5V, 2 A, L78S05CV