If I only had a heart

I recently coordinated the ‘tech’ for the school production of “The Wizard of Oz” and was really keen to see if there was a use for the Raspberry Pi in either the special effects or as a prop.


I decided to use the Pimoroni Unicorn Hat with a raspberry pi model A+ to provide a glowing animated heart for the Tin Man.


The code was relatively simple and I used a simple list to assign the x,y and colour data for each pixel to be used.


To give the effect of the heart beating and pulsating I gradually changed the brightness of the pixels from about 30 – 80%. It was important not to go too bright as I could have blinded the audience or other cast members!

while True:
for bright in range (30,80):

This gave a very passable beating effect which looked stunning on the stage. The Pi was powered with a portable battery pack and to make backstage life easier the code was activated from boot using crontab with.

@reboot sudo python /home/pi/Pimoroni/heart.py &

Wizard of Oz heart

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.