HP Forums
Science Project with HP41CX and Arduino? - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: Science Project with HP41CX and Arduino? (/thread-208194.html)

Science Project with HP41CX and Arduino? - Fouad M. Kaadou - 01-01-2012


I have a science fair coming up at school and was thinking of making an Arduino robot controlled by my HP41CX using the IR module on the 41CX.

Is it possible?

Thanks in advance,


Re: Science Project with HP41CX and Arduino? - BobVA - 01-01-2012

Depends on what you want to do. The IR link is one-way only, so you can't get data back from the robot.
But, it sounds like that you want to use the 41C as a handheld controller? That sounds workable, but you'll have to decide if it's worth the effort.
There are several articles you should be able to google up on the format of the IR printer data stream. Here's
a start.

You might need a dedicated Arduino on the robot for this - recovering the data from the IR stream can be a processor intensive task. The HP-41c side would be simple - just "print" the appropriate commands.


Re: Science Project with HP41CX and Arduino? - Fouad M. Kaadou - 01-02-2012

Thanks Bob. Yes I want the calculator to be the controller.

I'll do the research and see if its worth it. What about HP-IL? could that be used for a 2 way communication?



Re: Science Project with HP41CX and Arduino? - John Robinson - 01-02-2012

HP-IL will permit 2 way communication, perhaps you could use a PIL IO board, see : http://www.jeffcalc.hp41.eu/hpil/index.html


Re: Science Project with HP41CX and Arduino? - Garth Wilson - 01-02-2012

HPIL is a highly intelligent interface method that allows dozens of devices to be connected at once. There are interface adapters from HPIL to IEEE-488, parallel, RS-232, and video (I have all of these) but they're not cheap or easy to find these days. The HP-41 can handle all of these at once, and more, but be forewarned that it is not a fast machine. The HP-71 ran HPIL about 30 times as fast as the 41 did (around 5,000 bytes per second versus 150), and can process the incoming and outgoing info much faster too.

The HP-50g is in production today and is much faster than either of these, and, although it does not have HPIL, does have a serial port which I believe can be controlled to do a lot with it, if you write your software and make your devices to add the intelligence you need to split out signals to various processes and so on. I've used the 41 and 71 to control a lot of instrumentation and take data. Although I have a 50g, I can't say I'm familiar with it, and I think going the 50g route would require a lot more custom programming (it's not for casual users); but if you haven't already made a big investment in time and equipment with the 41 or 71, I tend to think the 50g might be the better way for you to go, based on computing power as well as support. Perhaps others can comment on that note.

Re: Science Project with HP41CX and Arduino? - yves - 01-02-2012


I can provide to the community a software library for interfacing HP-IL loop to Arduino.

(I originally wrote it when my girlfriend asked if that old funny calculator could do the coffee ? then I created what we may call a "vintage coffee/lamp/radio wake up device, with room heat temperature control"... ;)

This library handles signals provided by an HP82165A HP-IL GPIO Interface, allowing Ascii commands and responses between HP-IL controller and Arduino, Trigger signal handling for sensors measures, and Services requests for emergency...

I can also give you a basic program (sorry it's for HP71) to test Arduino protocol.

Due to number of pins needed by the GPIO interface (8 data lines, 6 hand shake lines, 2 hp-il signals plus ground), you'll need an Arduino Mega (and patience to connect the correct wires).


Re: Science Project with HP41CX and Arduino? - Fouad M. Kaadou - 01-02-2012

Hello Yves,

I would be very thankful if you could provide me with some of your programs. I think HP-IL is the way to go. If that fails I will rely on IR interfacing.

Thanks to all,


Re: Science Project with HP41CX and Arduino? - Christoph Klug - 01-03-2012

Muche more technical details about interfaching HP-41 by HP-IL to external interface hardware for advanced control and measurement applications
you find in my two books "HP-41 Input Output Board" and "IL2000 Interface System". Look under ebay Germany HP-41 - there you find this reference book...

Best regards - Christoph Klug

Re: Science Project with HP41CX and Arduino? - Fouad M. Kaadou - 01-03-2012

Hello Christoph,

Nice book I am inclined to purchase a copy. Does it directly discuss anything about arduino interfacing?

Re: Science Project with HP41CX and Arduino? - yves - 01-04-2012


You'll find the Arduino library for HP82165A GPIO Interface here :
Arduino library for HP82165A GPIO Interface

Enclose file HP71_Basic.txt is a sample basic program (for HP 71B) to dialog with Arduino.

Instructions :
- Turn on HP82165A GPIO Interface and connect HP-IL Loop
- Turn on Arduino and coonect SUB25 cable to HP82165A
- For this sample, Arduino is connected to 3 leds, 1 relay and a dht11 humidity/temperature sensor
- Run HP 71B basic program

Press key 1 to enter and send an Arduino Ascii command.

Commands recognized in HP71b.ino sample are :
- "red" : turns a red led on
- "yellow" : turns a yellow led on
- "green" : turns a green led on
- "blink" : blink all leds
- "on" : turns all leds on
- "off" : turns all leds off
- "up1" : turns a 220 V relay on (Switch on a lamp)
- "down1" : turns a 220 V relay off (Switch off a lamp)
- "srq" : tell Arduino to perform a service request interrupt (you can also press MSRQ button on HP82165A)

Arduino replies "OK" when command is recognized and handled.You may notice that Arduino also understand french commands, so that my children can also play...

- Press key 2 to send a trigger signal
In this example, Arduino send back humidity and temperature from a DHT11 sensor

Press key 0 to exit

Merry new year