Jump to: navigation, search
Project Embedded Bathroom Control System
Date 2001 - 2004
Goals Control the fan, light, radio in a bathroom based on presence, temperature and humidity
Dependencies GNU 68HC1x



The Embedded Bathroom Control System is a small system based on a 68HC11 and designed to:

  • Control the bathroom fan,
  • Control the light,
  • Control the radio (ie, music),
  • Display the temperature, humidity, ...

This system has several hardware components:

  • A 68hc11 board with 32Kb of ROM and 32Kb of RAM. This board runs the EBCS software.
  • An LCD board which provides a 2x16 LCD display with 4 buttons.
  • A Power Control board which has a transformer and 2 triacs (one for fan and one for light).
  • A Sensor module which provides temperature, humidity and presence detection.
  • A I/O board connected to the CPU board. This is the interface with the sensors, the power control board and the LCD panel.

EBCS Components

IO Board

The IO board:

Ebcs io board.jpg

Documentation on the chips used by EBCS IO board.

Documentation (1)


Hex schmitt triggers


Low Noise Single J-FET operational amplifiers


Positive voltage regulator (7805, 7812, 7815, ...).


PNP Silicon Transistor


NPN Epitaxial Silicon Transistor


PNP Epitaxial Silicon Transistor


Low Noise J-FET Operational Amplifier

(1) Documentation publicly available on various constructor web sites and copied here for archiving.

Power Supply and Triacs Board

The power control board:

Ebcs power.jpg

Documentation on the chips used by EBCS Power board.

Documentation (1)


Triacs (I've used a BT137-600).


6-Pin DIP Zero-Cross Optoisolators Triac Driver Output


NPN Silicon Transistor


Transformer ( Myrra ).


Optocoupler with Phototransistor Output

(1) Documentation publicly available on various constructor web sites and copied here for archiving.

LCD Board

The LCD panel with 4 optical buttons.

Ebcs lcd.jpg

Documentation on the parts used by EBCS LCD board.

Documentation (1)


Dot Matrix Liquid Crystal Display Controller/Driver


Quad NOR gate


Quad AND gate


Low Noise J-FET Operational Amplifier


8 Bit Sipo Shift Register


Octal D Type Flip Flop With Clear


N-channel vertical D-MOS transistor


Reflective Optical Sensor with Transistor Output

(1) Documentation publicly available on various constructor web sites and copied here for archiving.

68HC11 Board

EBCS Simulator

Since EBCS is installed in the bathroom, and to help in the development of the software, I wrote a simulator program that simulate EBCS completely. The simulator is composed of two parts:

  • A graphical part based on GNU Gtk is the simulator interface. It simulates the LCD panel, the optical keyboard buttons, the temperature and humidity sensors and show the status of the fan and light controlled by the system. The Gtk tool only simulates the I/O boards. It does not simulate the 68HC11.
  • A 68HC11 simulator which is part of GNU GDB. The GDB's simulator is very complete because it simulates all 68HC11 instructions and most of the 68HC11 IO devices (interrupts, I/O ports, timer, SPI, SCI, input/output compare, Analog inputs, eeprom, nvram). It is also accurate in the sense that it takes into account the CPU cycles taken by each instruction.


The Gtk frontend and the 68HC11 simulator communicate and synchronize themselves using two mechanisms:

  • A shared memory segment is used to represent the I/O ports
  • A TCP/IP connection is used to synchronize the CPU with the frontend when the CPU writes on an output port.

The CPU always reads input ports in an asynchronous manner, that is, it never waits for the frontend to give the information. Synchronisation only occurs when the CPU changes an output port.

The screen shot below shows the simulator window with EBCS 0.6 running.


The Gtk frontend was designed using Glade, the Gtk window editor.

Date File Description
2002-03-09 [ebcssim-0.2.tar.gz] Add light simulation, fix some problems, includes gdb-5.2
     patch for Ebcs<->Gdb HC11 simulator connection
2001-10-15 [ebcssim-0.1.tar.gz] First version; simulate LCD, buttons, fan and connects to
     GDB-68HC11 simulator


EBCS is a long term project started in 1998 while I was doing the plumbery and putting up the tiles in my bathroom. I had the idea to have the bathroom elements automatically controlled by a small system. It was just for fun, and for the interest in doing that.

This project depends on two others project that I started. First, I needed a C compiler, so I ported the GNU Development Chain for 68HC11. Second, I needed to burn an eprom, so I designed my own eprom programmer. Well, all this explains why it took so long to get it in my bathroom (3 years!!!).

Feb 24, 2002

Installation of EBCS v0.6 in the bathroom (compiled with GCC 3.0.3).

Jan 13, 2002

Installation of EBCS v0.5 in the bathroom (compiled with GCC 3.0.2).

Nov 24, 2001

Installation of EBCS v0.4 in the bathroom (compiled with GCC 3.0.2).

Aug 2001

Design EBCS software for controlling LCD panel and triac board, measuring temperature and humidity.

Jul 2001

Burn first Eprom for EBCS (not installed in bathroom yet).

Mai 2001

Made the EBCS sensor module.

Apr 2001

Design the EBCS Sensor module.

Sep 2000

Made the PPEP board.

Aug 2000

Design the PPEP to burn the 27256 EPROM of EBCS.

March 2000

Made the Power control, I/O board and LCD module.

Jan 2000

Design the EBCS LCD module with Eagle.

Dec 1999

Design the EBCS I/O board with Eagle.

Nov 1999

Design the EBCS Power control module with Eagle.

Mai 1999

Made the 68HC11 board, tested with bootstrap mode and 8K ram.

Apr 1999

Preliminary version of the C compiler, assembler, linker, debugger and simulator (arround GNU tools).

Nov 1999

Design of my 68HC11 board with Eagle.

Aug 1998

Preliminary idea to create EBCS arround a 68HC11

       (need a board, sensors, a C compiler, ...)


Personal tools
Open Source
Electronic projects