Electric heater controlled by the Commodore 64

Read in: IT 🇮🇹   EN 🇺🇸

We are now in winter and it is starting to get cold. What better opportunity for to make an electric heater controlled by the Commodore 64?

Subscribe my YouTube channel ValorosoIT. Retro technology, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

Collegamento dell'interfaccia per la stufetta elettrica comandata dal Commodore 64

To connect the electric heater to the Commodore 64 I used ainterface with 4 relays and photocouplers. L'interfaccia di espansione a 4 relay può comandare altrettanti carichi di 10A ciascuno. Avevo già utilizzato questo modulo per comandare una espresso coffee machine. This interface must be powered externally, using a 5V power supply.

Electric heater interface 4 relay outputs 10 Ampere 10A, user port Commodore 64 optocouplers, 5V power supply

The relay module connects to the Commodore 64 user port, by means of a 3.96mm edge 24-pole connector.

Commodore 64 user port electric heater, user port, 3.96mm edge 24-pin connector

Remember to turn on the Commodore BEFORE the interface, otherwise the relays will activate randomly and the heater will turn on without your consent!

For the same reason, when the experiment is over, it is necessary turn off the interface FIRST and then the Commodore 64.

Regarding the connections, I connected the normally open contacts of the relays to the control selector of the heater.

Electric heater connect user port Commodore 64 switch control selector ignition fan heater

Ho dapprima scollegato i faston dall'interruttore di comando, ovviamente segnando la posizione in modo da non scordarsi la posizione corretta.

Electric heater connected user port Commodore 64 replacement switch selector controls ignition fan heater fan motor resistance

Successivamente, ho collegato le uscite dei relay della scheda di interfaccia al posto dei contatti dell'interruttore, isolandoli bene con del nastro isolante e, ovviamente, spostandoli il più lontano possibile dalle resistenze. Il mio progetto è temporaneo, ma, in caso si volesse utilizzare la stufetta in maniera stabile con il Commodore 64, suggerisco l'utilizzo di cavi e guaine adatte per alta temperatura.

Commodore 64 user port controlled electric heater switch selector switch for ignition fan heater fan motor resistance, insulating tape

Operation of the electric heater

The operation of the heater is very simple: with one contact the fan is activated or deactivated, while the two resistances that heat the air are controlled with two other contacts. Obviously, the resistors must not be turned on if the fan is not active, but this aspect is managed by the software.

Follow me on Instagram channel. Retro technology, Commodore, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

So, summing up:

  • is activated fan with the Relay 1, connected to pin PB0 the Commodore User Port;
  • to turn on the first heating resistor we use the Relay 2, connected to pin PB1 of the C64 User Port;
  • to activate the second heating resistor we use the Relay 3, connected to pin PB2 of the C64 User Port.

With regard to power management, to obtain power 1, only one resistance must be activated. To obtain full heating power, both relays that control the resistors must be activated.

Be careful! There is electricity here! If you want to carry out this experiment, get help from someone experienced!

Basic software for managing the fan heater

The Basic program to manage the electric heater controlled by the Commodore 64 can be downloaded at the bottom of this page. E' disponibile sia in formato testo, per essere visualizzato da PC, sia in formato PRG, per essere avviato dal Commodore 64 o da un emulatore.

Per chi volesse approfondire, avevo descritto l'interfaccia e come controllare la User Port del Commodore 64, con le istruzioni in Basic, in this article.

Electric heater connected controlled user port of the Commodore 64 basic fan heater, joystick

To load the program I made in BASIC, I used the Kung Fu Flash, which behaves just like a real cartridge. As soon as the Commodore is turned on, the program is loaded!

The commands available are to control the fan heater with the Commodore 64:

  • 1 to turn on the fan;
  • 2 turns on the heating at power 1 (as well as the fan);
  • 3 to turn on the heater at maximum power;
  • 0 turns off the fan heater;
  • you can also exit the program by pressing X: when the program is exited, the heater is switched off automatically if it had remained on.
Electric heater fan heater user port Commodore 64 basic program management control

Finally, I wanted to improve the experiment by also using a joystick to control the electric heater!

Electric heater connected user port Commodore 64 joystick controlled fan heater

To turn the heater on and off, press FIRE.

When the fan heater is on, by moving the joystick up and down, the heating power can be adjusted, passing from "fan only" to "power 1" and then to "full power".

Basic commands to manage the coffee machine controlled by the Commodore 64

In the program listing, downloadable at the bottom of this page, there are some peculiarities. First, the command to activate the fan of the electric heater is:

POKE 56579, 1

Per activate power 1 (half power), with the fan, relays 1 and 2 must be kept on at the same time, therefore the following is used:

Follow me on Instagram channel. Retro technology, Commodore, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

POKE 56579, 3

Per activate power 2 (full power), together with the fan, relays 1, 2 and 3 must be kept on at the same time, so the command is:

POKE 56579, 7

Finally, for turn off the fan heater, you use the following command:

POKE 56579, 0

As I had already specified in this article, actually the command POKE 56579, number is used to set the pin of the PB port as the output. As soon as it is set as an output, the corresponding pin immediately goes to logic level 0 (to ground), therefore activates the relay.

List of the program in Basic

And here is the listing of the Basic program to manage the fan heater.

The program is available in two formats:

  • STUFETTA_C64. TXT, in text format, to analyze it on a PC (this file can not be immediately loaded or transcribed on the Commodore 64: to convert it into PRG you have to use C64LIST);
  • STUFETTA_C64. PRG, to be unpacked, in loadable and bootable format from the Commodore 64 and emulator.

Credits: in the video tutorial, SID music is Alloyrun by Jeroen Tel.

Subscribe my YouTube channel ValorosoIT. Retro technology, vintage audio, retro computers, experiments and tests. Retroprogramming, Basic. Commodore, IBM, Atari, Apple, Texas Instruments, Amstrad, MSX.

Posted in Retro Computer, Retro Technology and Vintage Electronics, All articles.

Leave a Reply

Your email address will not be published. Required fields are marked *