If you find some things that do not seem to work correctly when building a Gemini UKMARSBOT here are some tips that should help to diagnose and fix the problem.

Firstly make sure that the main chassis and mezzanine board are working as expected before adding the line or wall sensor board. If you connect the micro USB cable from your computer to the Pico processor board and open Thonny then hit the stop icon you should get the message “MicroPython v1.25.0 on 2025-04-15; Raspberry Pi Pico with RP2040 Type “help()” for more information.” This tells you that the Pico is working and you should be able to load a program on it. Write a program that starts with the import statements and the pin assignments for the mezzanine board from the Initial set up and Tests page, then add the code on the same page that for Testing the Mezzanine board. Run this from Thonny via the USB cable and it should run both motors forward and backwards and light both mezzanine LEDs. If the LEDs do not light one initially then the other after 5 seconds you may have incorrect resistor values for R1 or R2 or have the LEDs put in the wrong way round.

If you have to remove a component such as a resistor to replace it, slide a thin blade under the edge of the component then apply the soldering iron to one of the soldered contacts on the bottom of the board while applying very light pressure to the blade. The heated lead of the component should lift out. Now do this for the other lead and the whole resistor should come out. If you are lucky the component hole will be free of solder but if not, try putting the soldering iron on the blocked hole on one side of the board to melt the remaining solder while applying the solder sucker to the hole position on the other side of the board. If this does not completely clear the holes use a 0.8mm drill and carefully redrill the hole through the remaining solder.

Whilst the mezzanine LEDs will light up without the battery connected while connected to the computer with the USB lead, the motors require the battery to be connected and switched on. If the LEDs work but the motors do not turn, check the battery connections are the right way round, that the protection diode at the front of the chassis is he right way round and that the motor power leads are connected to the right pins marked + and – at the end of the 6 way motor connectors. Finally also check that the motor driver board is the correct way round and that when you plugged the mezzanine board into the main chassis connector you got all of the 6 pins on the 2 sets of connectors into the correct sockets. With a voltmeter you should be able to see the battery voltage at the protection diode and 5 volts coming out from the regulator. Motor direction can be changed if needed by swapping the + and – connections round on J1 or J2 if needed.

Once you have the chassis and mezzanine boards working you should be able to drive the robot around under program control. You can now add a line follower or a wall follower sensor board. Use the additional pin allocations from the Initial set up and Tests page that apply to the board being added then see if you can light the indicator LEDs on the sensor board and then read the line or wall sensors. You will need to trigger the line or wall LEDs with a line of code to switch on the transistors that control the LEDs. You can use print statements in your code to show the sensor readings while your robot is connected to the PC. If things do not work as expected, start by checking the resistor values are all correct on the sensor board and that the LEDs and phototransistors are the right way round. On the wall sensor LEDs the K contact should connect with the larger saucer shaped part within the right side of the LED, while the A lead should connect to the part that looks like half of an arrow on the left side of the LED. Similarly on the phototransistors the C lead connects to the saucer shaped part and the E lead connects to the arrow shaped part. Even on coloured LEDs it should be possible to make out the internal structure of the LEDs to ensure that they are the right way round.

If everything is connected correctly the right way round but still do not work, write a program to light the LEDs and then check that the voltage for the trigger(s) and for the indicator LEDs can be seen coming out of the Pico. If they are present there even without the sensor board connected then the program is working correctly. You can also look for the correct voltages being present on all the LEDs.

When all individual parts are working you can now write your code for line following, wall following or maze solving. there are some useful bits of code in the Python Code Snippets page