The Scary Mirror Episode 3

image
Scary Mirror - Table of Contents

Scary Mirror Part 1 |  Scary Mirror Part 2  |  Scary Mirror Part 3 |  Scary Mirror Part 4

Return to Halloween  

 

 

It's time to set up and write down some software.

Before coding I have completed the setting of the mirror to put it in the right position adding some more robustness to the structure.

image

Finishing the Structure

The mirror will be placed in vertical position, maybe en plain-air or against a wall. I have added four bolts on the back of the frame to keep the internal body stable in place; then I glued four cardboard blocks to protect the wires and connections keeping the back of the mirror about 10 cm away from the wall to easy the air circulation and avoid the Pl3 B+ become too hot.

imageimage

image

imageimage

image

Last, another couple of holes at the same distance from the top middle of the frame to fix the chain (an original, metal-like scary chain) to hang the mirror.

imageimage

System Configuration and Software: the Arduino Neopixel light controller

The initial idea was to control the Arduino board sending lighting commands by the Raspberry PI through the I2C protocol.

It was not the first time I controlled an Arduino, as well as other microcontrollers via 12C, but in this case I met a lot of problems. After spending some days trying any kind of software approach I realised the problem was somewhere else.

After wiring the circuit everything seemed ok but randomly the Arduino board (set as 12C slave) was not recognised by the Raspberry PI for a couple of seconds.

The workaround partially solving the problem was to check the 12C state with the I2C tools (the set or terminal I2C commands) on the Raspberry Pl. It seems that the cause is an issue emerged in the most recent distribution of the Raspbian Stretch distribution, in  conjunction with the Raspberry PI3 B+

Checking the I2C list of connected devices the command reset the hardware I2C component on the PI side and the communication works again for a while. Due this unpredictable behaviour the result is an unreliable communication.

After reading a number of posts on the PI forum and stack exchange site, all related to this issue, I definitely resigned and set the Arduino controlling the backlight as an independent system, running in conjunction with the rest off the scary minor implementation.

Related
Engagement
Recommended