Old Mac Donald Had a Riddle

by emdee401 in Circuits > Arduino

2550 Views, 15 Favorites, 0 Comments

Old Mac Donald Had a Riddle

WhatsApp Image 2022-03-13 at 12.47.29 PM.jpeg
WhatsApp Image 2022-03-12 at 8.16.17 PM.jpeg
farmer.png
front.png
WhatsApp Image 2022-03-12 at 8.12.56 PM.jpeg

What is it?

This is my digital version of an old riddle. A Farmer needs to take a Fox, a chicken and a sack of grain to the market. On the way he needs to cross a river in a small boat. In the boat there is only space for the farmer and 1 object a time. Without supervision, the Fox might eat the chicken or the chicken might eat the grain. How can the farmer get all items to the market? Depending on what country you are in, the version of the story might have different characters. In Holland we know it as the riddle of the farmer, wolf, goat and cabbage. What ever characters you use, the riddle is solved in the same way.


Why did you make it?

Many years ago, I published a version of this riddle in the ELEKTOR Magazine based on a attiny. It was time for an upgrade with onboard sound and Pixelleds.


What makes it special?

Apart from onboard pixelleds, this version is a generic Wav player. You could use it to give sound to your arduino nano.

Supplies

IMG_6324.jpg
pcbtop2.png

You'll need a PCB. You can buy or create your own pcb with the gerber files here:

PCB Production Files

You can order a pcb without components at PCBWAY.com


Or you can buy a pre-assembled version with all components here:

BUY Pre-Assembled PCB

You will also need an SB Card to store the sound files.

I Build a housing from acrylic panels that I cut using a laser cutter. The autocad file is available for download here:

Download AutoCAD file

I assembled the panels with acrylic glue and I used spacers m3 bolts and nuts to mount the pcb in the housing

Or you can choose to create your own housing.

If you are planning to make it portable, I 9V battery and a battery clip will come in handy.

Downloads

Preparing the Front of the Housing

IMG_6325.jpg
IMG_6326.jpg
IMG_6328.jpg
IMG_6329.jpg
IMG_6331.jpg
IMG_6313.jpg
IMG_6315.jpg
IMG_6314.jpg
IMG_6332.jpg
IMG_6339.jpg
IMG_6340.jpg
IMG_6341.jpg
IMG_6342.jpg
IMG_6345.jpg

After tapping m3 threat in the holes, I screwed in 4 plastic spacers and I carefully removed any plastic that sticks out on the other side of the front.

Preparing the front Foil

I printed the attached pdf file with a color printer and I use a laminating machine to plasticize it. The laminating foil I used has a self adhesive side so it's easy to stick it to the front plate of the housing

Next, I cut out the print on the red line so it will fit on the housing.

I used a scalpel knife to cut out all the bigger holes. The small holes for the speaker, I cut out using a punch tool.


The PCB

assembly PCB.png
Schematic_Old mac donalds_2022-02-27.png
pcbtop2.png

You'll need a PCB. You can buy or create your own pcb with the gerber files here:

PCB Production Files

You can order a pcb without components at PCBWAY.com

Or you can buy a pre-assembled version with all components here:

BUY Pre-Assembled PCB

If you didn't buy a pre-assembled version, you will need to solder all the components according to the assembly drawing and the part list.

However, the faster and easier way to go if ofcourse buying a pre-assembled version. In that case, All you need to add is an arduino NANO, a battery clip and a battery

If you are looking for the schematic, take a look at the attachment, It's pretty straight forward.

Assembling the Housing

IMG_6352.jpg
IMG_6347.jpg
IMG_6346.jpg
IMG_6356.jpg
IMG_6353.jpg
IMG_6354.jpg
IMG_6357.jpg
IMG_6349.jpg
IMG_6431.jpg
IMG_6430.jpg
IMG_6429.jpg
IMG_6428(1).jpg
IMG_6358.jpg
IMG_6359.jpg

Glue all together, except the bottom plate.

Take note of how I mounted the battery. I placed some rubber dots around the battery and I pasted some foam tape on the bottom plate to keep the battery from moving around and shorting out the electronics.

In my version, I extended the switches will small cilinders that I cut from 10mm Acrylic. I simply but carefully glued them on the top of the switches. For the remaining windows I used acrylic bars, also cut with a laser cutter, glued into place.


Uploading the Sketch ( Firmware )

I used arduino IDE to upload the sketch.

Make sure you select the right board, programmer and bootloader for this to work.

I made a video that shows you the settings I used.


Downloads

Preparing the SD Card

You need to format the SD Card and put all the wav files in the root directory.

If you want to replace the files with your own sounds, all you need to do is use the same file names and following this file format: 16 bit 16Khz sample rate MONO


Show and Tell

IMG_6361.jpg
WhatsApp Image 2022-03-12 at 8.12.56 PM.jpeg
Old puzzle solved with Arduino

Did you solve the riddle? It's not that hard just keep trying.

I did a Video on this item here: