HARDWARE AND SOFTWARE
Microcontroller and Raspberry pi projects
In this project it will be shown how you can easily built up your own MagicMirror with voice control. You can learn to program your own MagicMirror modules and how you can write your own scripts for your voice commands. Feel free to use also other project ideas for e.g. smarthome solutions (switch of television or lights).

Equipment:
switch time socket e.g. here
raspberry pi 3b or higher, power adapter, SD-CARD, HDMI connector e.g. here
ultrasonic sensor HC-SR04 e.g. here
jumper wires e.g. here
some resistors
suitable case e.g. here
old monitor with optional VGA-HDMI adapter e.g. here
spy glass or foil e.g. here
USB sound card
microphone
speaker
wood for the frame
tape
soldering iron with solder
Short discription
Install Raspberry Pi OS on raspberry (link)
Install VNC client for remote controll and programming (link)
Install MagicMirror software (link)
Configure your Mirror, program own modules (link)
Connect USB sound card, speaker and microphone to your pi
Install JARVIS and implement own scripts with python (link)
Connect US sensor and write script (link)
Set Cronjobs for reboot and shut down of the system (link)
Starting system automatically over switch time socket
USEFUL SCRIPTS AND HINTS
US-SENSORSCRIPT FOR CONTROL THE HDMI PORT
import RPi.GPIO as GPIO
import time
import os
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
trigger = 16
echo = 11
GPIO.setup(trigger,GPIO.OUT)
GPIO.setup(echo, GPIO.IN)
def distance():
GPIO.output(trigger, True)
time.sleep (0.00001)
GPIO.output(trigger,False)
start=time.time()
stop=time.time()
while GPIO.input(echo)==0:
start=time.time()
while GPIO.input(echo)==1:
stop =time.time()
traveltime=stop-start
distance=(traveltime * 34300)/2
return distance
if __name__ == '__main__':
try:
while True:
abstand = distance()
print ("Measured distance = %.1f cm" % abstand)
if abstand > 100 or abstand < 10:
os.system("vcgencmd display_power 0")
else:
os.system("vcgencmd display_power 1")
time.sleep(300)
time.sleep(5)
resetten
except KeyboardInterrupt:
print("Measuring stopped by user")
GPIO.cleanup()
JARVIS TROUBLESHOOTING
If you get an error try that: https://github.com/alexylem/jarvis/issues/129
SUDO CRONTAB -E OR CRONTAB -E
Use only crontab -e [without sudo] to implement your Cronjobs
GPIO.BOARD VS GPIO.BCM VS WIRINGPI
Board= Pin numbering on the hardware device itself physical - starting with 1. To find out BCM and wPi use:= gpio readall in command window
