Kit Assembly Guide
This tutorial provides instructions for how to prepare your own PublicSensors kits. It provides instructions for soldering various components and optional instructions for assembling everything into an organizer for best use in a classroom setting. For sensor builders working independently, these later steps may not be necessary.
As a reminder, the following materials are PublicSensors kit components. Click icons for suggested links to purchase materials. Materials may be available cheaper in bulk at other distributed than those suggested. Some components require assembly prior to use. Others will be ready to use straight from the packaging.
Solder the Microcontroller
This section requires you to solder header pins on to the microcontroller. Header pins are needed to attach the microcontroller to a breadboard for circuit building.
If you are new to soldering, check out this video that introduces the skill and practice before trying to solder your microcontroller.
Header pins typically come with the microcontroller and you can use small pliers to break off the necessary lengths as shown in the photo to the right (Figure 1.1).
Use a breadboard to secure the pins and microcontroller as shown in the steps below.
1. Place header pins on breadboard
2. Position microcontroller on top on header pins
3. Solder pins in place
4. Remove microcontroller from breadboard
Upload Firmware to the Microcontroller
Below are instructions for one method to install the micropython firmware on to the microcontroller which will work using Windows, Mac, and Linux computers. For additional details and other installation methods, see the instructions from Adafruit.
1. Download and install the STM32CubeProgrammer. You will need to register and will get an email confirmation with the link to download the software.
2. Connect Pin B0 to one of the 3.3V pins using a Female/Female jumper directly attached to the headers or via the breadboard.
3. Connect the microcontroller to your computer using the USB cable and launch STM32CubeProgrammer.
4. Select the Erasing & Programming tab.
5. To connect to the microcontroller, first select USB from the connection drop down menu.
6. In the Port menu, select the available USB connection. If the microcontroller is detected, the serial number of the device will update.
7. Click on the Connect button.
After connecting, the programmer will read through the microcontroller’s flash memory.
8. Select the firmware file. The .hex file can be downloaded from the PublicSensors GitHub page. Optional: By selecting Verify Programming, the software will check that the firmware works once uploaded. Run after programming will reset the microcontroller and connect to it without the bootloader, automatically disconnecting it from STM32CubeProgrammer.
9. Click on Start Programming to update the firmware. The software will be begin by erasing the flash memory on the microcontroller then proceed to upload the firmware.
Once the upload is complete, you can disconnect and close the programmer.
Transfer Python Files to the Microcontroller
2. Additional Soldering
If you plan to use the battery charger and the light sensor they will need to solder header pins on them using a similar method as above.
Solder Pins on the Light Sensor
1. Place pins on breadboard
2. Position light sensor on pins
3. Solder light sensor on to pins
Solder Pins on the Battery Charger
1. Place four header pins on a breadboard
2. Position battery charger on pins. Pins used: IN+, IN-, B+ and B-
3. Solder battery holder on to header pins on breadboard
3. Create breadboard compatible connectors
While there are several components that will be ready to use right out of the box, a subset will require some assembly to attach wire ends that will enable you to plug the component directly into a breadboard. These components often come with stranded wire which is flexible and frays so it cannot be plugged into a breadboard well. The components that require new ends are the temperature sensor, thermistor and battery holder. While creating heat shrink solder connections is our preferred method, you can use any other method to connect new ends including crimping ends directly on the wires, or straight soldering of wires together.
Below are instructions for the temperature sensor. The same process can be used for the battery holder and the thermistor.
Attach Connectors to Temperature Sensor Wires
When removed from the package, the temperature sensor wires will look like Figure 3.1. They first need to be stripped such that they look like the Figure 3.2.
Use helping hands or a clamp to secure the position of the heat shrink solder connectors as shown in Figure 3.5. Make sure that the two stripped wire ends overlap in the the solder section of the connector. When heat is applied from the heat gun, it will melt the solder and connect the bare metal wires.
If you have not used heat shrink solder connectors before to connect wires, check out this video of the process.
If you are new to using a heat gun please make sure take precautions to you and others safe. It will get hot. Do not point it at yourself or others or other objects that are not meant to be melted.
When completed, the connections should look like Figure 3.6. You may stop at this step. If you would like your connections to look cleaner, you can add a layer of heat shrink over these connections. This can help increase the durability of you materials and is good especially if using in a classroom setting or in a situation where many students will use them.
After applying the heat shrink tubing, your connections should look like Figure 3.7
Attach Connectors to Battery Holder Wires
Use the same procedure to add breadboard compatible connectors to the battery holder. We recommend adding female ends to the battery holder to prevent the battery from shorting (Figure 3.8).
You may add male ends if you would like as well.
4. Prepare the Kit Box (optional)
Start with the plastic organizer that will hold all of the sensor building materials.
Grab the connected dividers that come with the organizer and cut them apart.
Select 13 dividers and place them in the positions pictured in Figure 4.2. This configuration will enable all 18 kit parts to fit in the plastic organizer
Grab the colored sticky dots and add them to the organizer sections to designate places for sensor parts as shown.
Print labels for each section using the label template. The labels contain both English and Spanish translations for the kit components. Add labels below the colored dots as shown in the photo to the right. For small sections (battery charger, button, resistors, LEDs and light sensor) the ends of the label will need to be trimmed to fit.
The diagram below gives more detail to set up the labeled color coded sections of the kit organizer.
Cut two 6″ lengths of Velcro (one side). Peel of the tape and attach them to the top of the organizer box as shown. Save the length of the opposite side of the Velcro for later. The Velcro on the top of the kit box enables it to be used as a portable workstation such that components can be secured to it.
Cut 3 strips of 2″ lengths of Velcro (opposite side) to attach to bottom sides of battery holder and breadboard. Attach two strips to either side of the bottom of the breadboard and one strip to the bottom of the battery holder (Figures 4.7, 4.8). When attaching the Velcro to the breadboard, it helps to remove part of the paper covering where the Velcro will be attached (Figure 4.6) and attach it directly to the sticky pad (Figure 4.7).
Add parts to the kit box
Add all parts to their designated spots in the kit organizer. Photos below show the the final assembled PublicSensors kit and how the Velcro is used to secure parts for sensor construction. The glass thermometer pictured is included in a bubble wrap pouch for protection.
Congratulations! You’ve constructed a PublicSensors kit!