LuminAero Speed

Assembly Instructions

I think building the fuselage is the place to start, to get the hang of the construction method.

Downloads

Fuselage

Don’t solder anything just yet.

I suggest that you place the two sides vertically on your building board, place F1 and two of the F2 in place then hold it together with elastic bands. You don’t want to squeeze it too tight. Then fit the wing and hatch mounts and the servo mount.

Place a bit of weight over the top to hold everything flat to the table, and check everything is square.

Once you’re happy, quickly solder one or two pads on each PCB join, so it holds itself together. Note that just tacking single joints like this makes each joint very weak, so don’t put any twist or pressure on it.

Check again that everything is straight and true, then solder everything else. There’s a lot of solder joints to do. Top and bottom, inside and outside, etc.

You should now have a solid monocoque.

You can download plans in PDF format for the fuselage sides. These can be printed full size on multiple A4 sheets, or just use the dimensions given to cut them out – all edges are straight lines so it’s easy.

Cut the two sides out, following the plan and ensure they are identical. Then line them up one at a time against the PCB assembly. When you’re sure it’s in the correct place, press the balsa against the PCB joins to mark where to remove bits of balsa. This will allow the balsa sheet to fit directly against the PCB.

[Photos required]

Use epoxy and spread it over the PCB where the balsa contacts, then attach both sides and clip them against PCBs. I use lots of small bulldog clips for this.

Click to enlarge

Wing

The wing is much more fiddly than the fuselage as the pieces are smaller and there’s a lot of them.

I find it easiest to start from one side and work my way across to the middle, then back out to the other side. The images below show working from Port to Starboard.

1 Check the parts are correct

Port set on left from wingtip at bottom to root rib at top.
Starboard on right from wingtip at top to root rib at bottom.
Note the different configuration jumper settings on each rib and the tabs on the root ribs

Place Root Rib over the lower spar and use a small square to ensure rib is vertical and at right angles to the spar. Note the orientation of the horizontal brace – production code visible and at the rear
Solder one joint to the root rib on each of horizontal and vertical braces
Then solder one joint of each onto the first main rib
Use finger pressure and soldering iron to melt solder and ensure both braces are fully against each rib to ensure they are square
Here you can see the vertical brace with the inboard side tab at the top and the outboard tab at the bottom. This is crucial !
Start adding the horizontal and vertical brace for the next panel
Again ensure that both ends are fully against the ribs
Use a small piece of 1/8″ square balsa to help line up the top of the vertical braces
Here you can see the braces being pushed against the rib to ensure tightness.
At the same time, use a soldering iron in the other hand to melt the solder joints
Squeezing the two horizontal braces either side of a rib. Use soldering iron to melt the two solder joints while the pressure is being applied
Use a bit of scrap balsa to lift up the braces near the root rib because of the tabs on the bottom of it
Take particular care to ensure this rib is square in all directions
Solder the root rib to the base, ensuring it is fully pressed down front and rear
Note the orientation of the base, with the components underneath

Continue adding ribs, starting with the Starboard root rib, all the way to the wing tip.

Ensure that the higher tab on the vertical web braces is on the inboard side – this means the PCBs are the opposite way around from the port wing.

Check that everything is totally square and flat to the building board – you will need a gap in the building board, or use two boards, to enable the centre section to lie below the level of the rest of the wing.

When everything is square, solder up all the joints. Remember that every joint (except those on the edges of PCBs) has four solder positions: top, bottom, left, right.

AstroHub Range

A selection of USB and Power hubs useful for astrophotography

Budget electronics by astronomers, for astronomers

Purchase >Here<

Downloads

These applications and drivers are not digitally signed, so you will have to approve them for installing


Application History

  • 1.0.6 Fixed bug not storing Bipolar stepper mode. Added reversing of motors for focuser
  • 1.0.5 Initial bug fixes
  • 1.0.4 First Release version
  • 1.0.3 Initial “Working” Release

ASCOM Driver History

  • 1.1.4 Fixed bug with negative temoperature readings
  • 1.1.3 Fixed bug with Absolute mode setting incorrect values
  • 1.1.2 Initial “Working” Release

Product Overview

There are a number of products in the range that can be controlled and/or monitored using the AStroHub application software.

Each product comprises a selection of standard building blocks, so you can select the one in the range that has the appropriate set of blocks for your equipment.

These building blocks are:

  • USB hub with various quantity, power output and type of USB connections
  • Focus motor control. DC motors and stepper motors
  • Temperature monitoring with optional temperature probe and focus temperature compensation
  • Dew heater controllers: controlled, monitored, protected
  • 12V DC outputs: controlled, monitored, protected
  • EQMod direct connection for many SkyWatcher (and Orion) mounts

Focuser Motor Control

The same focus motor control is used for all products, except the Focus RF (which doesn’t have a connection to the application).

Remote Controller

For Focus RF, the remote controller uses buttons 1, 3, 5 and 7 to move the motor one way; and buttons 2, 4, 6 and 8 to move it the other way. Buttons 1 and 2 are the slowest and buttons 7 and 8 are full speed. You can set the slowest speed so that it works on your rig. See the Focus RF blog for more details.

For Focus RFU, MiniHubs and AstroHubs the remote has two different modes of operation:

  • Continuous. If Button 7 is pressed then continuous mode is selected. Here the buttons 1 to 6 work in the same was as for Focus RF – while the button is held pressed the motor will continue to run (*). Buttons 1, 2 are slowest and buttons 5,6 are fastest. The speeds can be set using the Windows app
  • Step mode. If button 8 is pressed then stepping mode is selected. Pressing buttons 1 or 2 will move one “stride”, pressing 3 or 4 will move 5 “strides” and pressing 5 or 6 will move 25 “strides”. Each “stride” can be set to a number of steps from 1 upwards, by using the Windows app. This step mode allows changes via the remote control to be fed back to the Windows app, or ASCOM driver so that the absolute or relative position of the focuser is reported.
  • (*) Continuous movement of the motor will stop if a command is sent to the unit over USB. The USB commands will take precedence over the remote controller. You can set the scan rate if using the Windows app so it doesn’t interrupt too often.

Selecting DC or Stepper Motors

All except Focus RF can support stepper motors (both Unipolar and Bipolar) as well as DC motors. Everything is configured for DC motors when shipped, so you will need to change this using the Windows app if you want to use stepper motors.

There are two parts to operating stepper motors. Firstly, you need to wire up the motor correctly either by making a cable, or by using the optional focus motor adapter. Secondly, you need to set the stepper motor characteristics in the software – either via the ASCOM setup dialog, or from the Windows app, depending which you are using.

Wiring Motors

In this section we will use the Focus Motor Adapter PCB as shown below. You will need an RJ22 cable to connect from the Focus RFU, MiniHub or AstroHub to the adapter.

  • DC Motors: Use the top two connections labelled “DC Motor & Coil 1”
  • Bipolar (4-wire) Stepper Motors: Use the top 2 connectors for coil 1 and the next 2 for coil 2
  • Unipolar (5-wire) Stepper Motors: Use the top 2 connectors for coil 1 and the next 2 for coil 2. Then use either of the bottom connectors for the common/power wire.
  • For all stepper motors, you may have to experiment with the polarity of each coil before it operates as expected. Every motor is different, but they all need their coils to be energised in the correct sequence and the correct polarity

Setting in Software

In the Windows app or the ASCOM driver setup dialog, you can select the type of motor you are using (DC, Bipolar or Unipolar).

For stepper motors you can also set the step delay in ms. This is the delay between each step of the sequence and again will vary from motor to motor. You should set it to a slow value (say 10 – 20 ms) to begin with until you are sure you have the wiring connected correctly. Then speed it up until the motor runs smoothly. Probably around 2 – 5 ms.

EggBit – Wearable Microbit

Purchase >HERE<

Overview

EggBit is a new wearable product for the popular Microbit. It comes with built-in RGB lights, buttons, animatable LED mouth and ultrasonic distance sensor. It also incoporates a battery pack, on/off switch, indicator LED and power circuitry.

EggBit is available in 3 functionally identical flavours: Sunshine, Twinkle and Dizzy

Coding them in Makecode is simpe. There is a Makecode extension written especially for them. Seacrh for EggBit in the EXtension search box.

Programming with Makecode

First you should load the EggBit extension to Makecode. Go to the Advanced section and select Extensions. Then in the search box, search for EggBit and then press Enter.

Then you can explore the various options. Within the EggBit extension are three categories: Input/Output, FireLeds and More

Input/Output section contains blocks to work with the buttons, the animatable mouth and the iultrasonic distance sensor.

FireLeds section contains the basic functions for driving the nine FireLeds, including use as a Larson scanner and a bar graph,

More section contains the advanced FireLed functions. Generally these will not be required.

Buttons

The four buttons can be coded in different ways. At any time in your code you can check the state of the button: whether it is pressed or not pressed. Alternatively, you can select a block that is only activated when the specified button is pressed or released (event-driven programming).

The following shows the method of checking the state of a button. This block is a “Boolean” value which can give the result True or False. It returns True if the button is currently pressed, otherwise it returns False. So it can be used directly in an if/then/else block as shown below. This example sets all the FireLeds to Red if the red button is pressed, otherwise it switches them off.

Using the event-driven model is equally simple. Select the button you want and whether you want to activate the block when the button is pressed, or when it is realeased. Then within the block you can run any code. The following two blocks set the mouth to Smile when the Yellow button is pressed and set it to Sad when the Blue button is pressed.

Mouth

The animatable mouth has three separately controllable sections: Upper, Middle and Lower. You can control these sections individually if you like, or you can use the predefined expressions. As there are three sections and each can be either On or Off, there are eight possible configurations of the mouth.

For instance, to make an open, happy smile you would light the middle and lower sections, leaving the upper section off. You can do this by setting each part individually, like this:

Or you could use the predefined expression, OpenSmile:

Ultrasonic Distance Sensor

This is a standard HC-SR04 type sensor that is specified to work from a few centimeters to a couple of metres. Note that as the beam angle is large, the further away the obstacle is, the larger it needs to be to provide sufficient reflection. This is normal behaviour.

There is only one block for the ultrasonic sensor, which returns the distance to the nearest reflective object. You can select whether to get the answer in centimetres, inches or microseconds. In the following example, we set the FireLeds to Red if the object is less than 50cm away, Orange if less than 1m away, otherwise we set it to Green.

FireLeds

The EggBit has nine FireLeds, which are individually addressable RGB LEDs. You may have previously known them as neopixels. Each FireLed can be set to any of 16 million different colours, because the brightness of Red, Green and Blue components can each be set using 8 bit data (256 values each). To simplify setting the colours, we have produced a palette of 25 basic colours

However, you can set the colour directly using the “convert from red, green, blue” block in the More category. Simply drop the convert block on top of the colour:

As well as setting all FireLeds to a specific colour, you can switch them all off using the “Clear all FireLeds” block, or set just a single FireLed to a specific colour using the “set FireLed at” block. The nine FireLeds on EggBit are clearly labelled with their number, from 0 to 8. This example sets FireLed 5 to Pink

Larson Scanner

You can set the Larson Scanner going by specifying the colour to use and the delay between display updates. The shorter the delay, the faster the scanner goes. Typically we set the colour as Red and the speed as 100 or 200ms

Use the “stop scanner” block to disable the scanner.

Bar Graph

The nine FireLeds can be configured as a bar graph, with the leftmost FireLed (0) being a low value and the rightmost (8) being a high value.

First, you must set up the parameters for the bar graph to work with. The system needs to know the colours to use for start and end and the value assoicated with the lowest LED and the highest LED. Use the “set graph” block to do this. The example below sets the range of values to be shown as 0 to 100 and the colours from Green to Red. The system will slowly change the colours so that the overall change starts at Green and ends at Red – in between there will be various shades of colour.

Now you can draw a bargraph by providing it with a number. The number doesn’t have to be in the range given, but anything higher than 100 (in the example above) woiuld be treated as 100, and anything lower than 0 would be treated as 0. The example below uses the value from the ultrasonic distance sensor to set the bargraph:

DriveStraight (TM)

For the latest releases of Minibit and BitBot XL, 4tronix have added DriveStraight technology in the hardware and Makecode extensions.

This works using a Flash memory chip which stores the calibration details of the motors at three different speeds: 30%, 60% and 90%. This information is used to generate the actual speeds used for each motor to give the best chance of moving straight ahead when required.

Because this data is stored in permanent memory, it only needs to be calibrated once and then it will automatically be used from then on. You don’t have to do anything in your programs for it to be used and it doesn’t matter if you change the Microbit at any point. The calibration data is specific to the robot it is created on – it isn’t related to the Microbit at all. So you can swap between Microbits including v1 and v2 types.

You may find that the calibration data changes over time as the motors wear differently. If it gets too far out, then simply run the calibration program again.

DriveStraight is built into the latest Makecode extensions. It isn’t available in Python, although you can access the Flash memory from Python and use it yourself.

On the Minibit, you also have user access to the rest of the Flash memory. You can use this for what you like: storing sequences, remembering particular LED settings, etc. This feature will be added to the BitBot code shortly.

BitBot XL calibration code >here<

Minibit calibration code >here<

Calibrating the Motors

Note that this code only works on BitBot XL v1.2 or later, or Minibit v1.3 or later.

Process: The calibration program starts at speed 30 (displaying 3 on the Microbit LEDs). You then set the left or right speeds until it is driving straight. Then give the robot a good shake and it will change to speed 60 (displaying 6). Set this speed, shake again to change to speed 90 (displaying 9). Once this speed is set correctly, shake again and it will return to speed 30. You can then switch off and all the values are stored. If you run the program again, you will start from the un-calibrated values and must follow all the steps again.

  • Load the program into the Microbit and plug it into the robot
  • Switch on the robot. It will display 13 (indicating a v1.3 Minibit) or 5 (indicating a v1.2 BitBot XL), then change to show 3 (meaning speed 30)
  • Press A or B buttons to affect the turning left or right, then press both A+B simultaneously and the robot will display the current calibration value, then move forward for 2 seconds at speed 30.
  • If it is still not moving straight, press the appropriate button one or more times to straighten it up, then press A+B again to test it
  • When you’re happy that it is moving straight, give the robot a shake and it will store the values for speed 30 and move onto Speed 60.
  • Repeat for speed 60 and speed 90
  • When you’re happy that all three speeds are set correctly, then switch off. Don’t switch it back on again without changing the software in the Microbit, because the first action of the calibration program is to reset the calibration values.

Dew Heater Controller

Purchase Here

Overview

The 4tronix dew heater controller is available in both 2-channel and 4-channel versions. Apart from the number of channels, they are identical in operation – in fact they use the same PCB and the same code on the internal microcontroller.

Each channel is fully variable from completely Off to permanently On. The positions in between are managed using PWM (Pulse Width Modulation), which is a method of reducing the overall power usage, while keeping the voltage level the same. Basically, it provides power at the input voltage for a certain percentage of the time, with the power off for the rest of the time during each period. Each PWM period is only about 2ms, so you won’t see any fluctuating values.

There is an indicator LED on each channel to give some indication of the power selected. If the indicator LED is Off, then there is no power being provided to the dew heater. If it is On solidly, then the full input voltage is being provided to the heater. In between, the LED flashes. A slow flash indicates little power and a fast flash (up to 30 Hz) indicates more power. Note that the flashing of the LED is not the same as the PWM values on the heater outputs.

The Dew Heater Controller can operate happily from about 7V up to about 15V. The driver for each channel is rated at over 4A, but do not use all 4 channels at 4A – other parts of the circuit won’t cope.

The power is supplied via a 5.5mm DC Jack, with centre Positive. There is a reverse polarity protection circuit inside, just in case you get it wrong.

FocusRF – Remote Control for AutoFocusers

Purchase Here

Note: See the AstroHub blog page for information about the Focus RFU as the method of using the remote is different and for information on using the Windows application. There are more products available in our AstroHub and MiniHub ranges as shown here

Overview

The 4tronix Focus RF system replaces the manual handset in the Skywatcher compatible auto-focuser kit. It provides a simple wireless interface to control the motor at 4 different speeds with the fastest speed determined by the power supply used and the slowest speed being configurable.

The left buttons (1, 3, 5, 7) turn the motor one way and the right buttons (2, 4, 6, 8) turn the motor the other way. Buttons 1 and 2 are slowest, buttons 7 and 8 are fastest.

You can add, delete or replace remotes (requires the case to be opened)

Normal Operation

You can power the FocusRF from a 9V PP3 battery which can be fitted inside the case, or you can use an external 9V to 13V power supply with a 2.1mm DC Jack, centre positive.

Clip the end of the cable from the motor into the RJ22 in the FocusRF, instead of into the handset. All is now ready to go.

When the switch is moved to ON, the Red LED will initially come on solidly for a few seconds, then begin to flash slowly.

Press any of the buttons on the remote (which has already been paired to your FocusRF before shipping) and the green LED on the FocusRF will come on and go off again when you release the button. The focus motor will turn while you hold the button, then stop when you release it.

Speed Configuration

(Focus RF only) The default slowest speed may be too slow for your setup: the battery may not have the power to turn the motor, or the motor is too stiff to move for instance. Alternatively, you may want an even slower speed – especially if you are using an external power supply of more than 9V.

During the few seconds after switch on, when the Red LED is on solidly, press button 7, then 8 on the remote. This enters speed configuration mode.

Then press any of the buttons 1 to 8 to set the minimum speed. The default setting is 5. After pressing the selected speed, FocusRF will store the new minimum speed even during power down, removal of battery etc.

Pressing any button other than 7 then 8 at the start, will immediately move to normal operation and start moving the motor at the speed given.

Configuring RF Remotes

The 433MHz RF interface to the remote control is handled by a small daughter board inside the FocusRF unit. Using the button and the LED on the daughter board, you can add new remotes, delete all remotes and set configuration mode.

There are four screws on the bottom of the FocusRF case which you need to unscrew to get at the daughter board. You do not need to remove the internal PCB or the daughter board.

Add New Remote

  1. Switch on the FocusRF
  2. Press the button on the daughter board briefly – the Green LED on daughter board will light solidly
  3. Press each button on the remote in turn, from 1 to 8. The Green LED will briefly turn off to acknowledge each button press.
  4. When all 8 buttons have been pressed, press the button on the daughter board briefly again – the Green LED will turn off and the new remote is now stored

Delete All Remotes

For remotes since November 2021:

  1. Switch on the Focus RF
  2. Press the button on the daughter board three times in quick succession
  3. The Green LED will flash quickly for a few seconds while it clears the memory
  4. When the Green LED goes out, switch off the Focus RF
  5. All stored remotes are now cleared

For remotes prior to November 2021: Note that this function also clears the configuration mode, so you will also have to reset this (next section)

  1. Switch on the FocusRF
  2. Press and hold the button on the daughter board
  3. After a second or so, the Green LED will flash once (keep pressing the button)
  4. The Green LED will then flash twice, then 3 times, 4 times, 5 times and 6 times
  5. After it has flashed 6 times, release the button
  6. The unit has now been reset and has forgotten all remotes and all configuration settings.

Set RF Configuration Mode

The RF module is capable of several operation modes. FocusRF uses Mode 1 or Mode 2 depending on the wireless receiver model that has been fitted. All other modes will result in unreliable operation. The following operation sets Mode 2, all units shipped after November 2021 use Mode 1 so stop after step 3 and release the button.

  1. Switch on the FocusRF
  2. Press and hold the button on the daughter board
  3. After a second or so, the Green LED will flash once (keep pressing the button)
  4. After another second, the Green LED will flash twice
  5. Release the button
  6. The unit has now been set to Mode 2

XLED – Finderscope Reticule Illuminator

XLED Illuminator

Purchase here

Overview

When trying to get a planet such as Mars into the field of view at high magnification, you really need to see the cross-hairs in your finderscope. If you’ve been looking at a laptop for the last few minutes getting the settings right etc, you will have difficulty seeing the cross hairs. This nifty device shines 8 dim red LEDs onto the surface of the lens, making the cross hairs stand out clearly.

It doesn’t use a battery, just a super-capacitor. This means it can be charged very quickly in just one minute. The Start button turns the LEDs on for 45 seconds and then turns them off again to preserve the charge in the super capacitor. You can press the button at any time to get another 45 seconds worth of illumination. Typically one charge will last more than one session.

Finally, there is a small switch to adjust the brightness of the illumination from “Dim” to “Dimmer”.

Fitting the XLed

This version is designed to fit snuggly around a 50mm finderscope such as those by SkyWatcher and Celestron.

The package contains 3 rubber coated pillars and 3 screws. Simply screw the pillars onto the bottom of the  XLed. The pillars fit on the other side to the majority components and the pictures of Saturn, comet and stars.

Plug the XLed into a USB port and the LEDs will come on. Wait a minute (or until the LEDs turn off) and then you’re done.

Now slide the XLed onto the finderscope and press the button when you need illumination.

 

Newtonian Secondary Mirror Heaters

Secondary Mirror Heaters

Click on any image to enlarge

Purchase Here

Overview

This heater panel is fitted to the rear of the secondary mirror in a Newtonian telescope (this model is designed for Skywatcher 200 or Celestron C8-N models).

A 12V supply, either direct or via a dew heater controller, is connected and then it will dissipate up to 3W over the rear surface of the mirror. This banishes dew and ice build up on the mirror’s surface.

The heater comprises 24 (varies with model) heater points (resistors) and so spreads the heat evenly across the surface. The heater panel is fixed using double-sided thermally conductive tape (included) or pre-fitted adhesive.

The connection to the panel itself is via a 2mm JST connector, but there is a JST to Phono cable included with thin wires to minimise damage to the light path.

Fitting Instructions

Step 1 – Check you have the Parts

You should have:

  • Heater PCBA
  • JST to Phono lead 50cm
  • Sheet with pieces of Blue thermally conductive tape and black insulation tape (some models are supplied with pre-fitted adhesive instead of the blue tape)

Step 2 – Fit the Thermal Tape to the PCBA

Some models are supplied with pre-fitted adhesive. For these, you should peel off the backing paper carefully, then place the heater on the back of the mirror. You can move it for a while as long as it isn’t prssed on too hard, then the adhesive will set harder. Skip to step 3.

If you have the blue tapoe, then peel off the tape from the backing sheet and apply it to the side with the resistor chips on, making sure to cover all of the resistors. Cut the tapes where they cross, to ensure that there is NO overlap – we need the same height of adhesive all over so it attaches properly.

Then trim the excess tape away from the edges using a sharp craft knife or scissors, so it now looks as shown above.

Step 3 – Prepare to Fit to the Mirror

Peel the Blue backing tape off the double-sided tape as shown above.

You may find it easier to attach the Phono cable at this point. Pros: it’s easier to attach when the heater is not fixed to the mirror. Cons: it causes extra force on the heater while the adhesive is hardening (note that the adhesive never fully hardens, but it gets stronger after an hour or two – faster if the heater is switched on)

Step 4 – Attach the Heater to the Mirror

“Simply” press the heater PCBA onto the back of the mirror and leave it a while for the adhesive to cure. The adhesive does not harden fully, so you can always remove it in teh future if required.

The problem here is that a) you must not touch the front of the mirror with your fingers and b) you want to put as little force on the mirror mounting as possible. So use cotton gloves or a piece of tissue to protect the mirror and squeeze the PCB and mirror together – don’t push against the mirror, squeeze the two parts together.

Step 5 – Tape up the Phono Cable across the Mounting Vanes

Use the black tape provided to attach the cable to the mirror mounting vanes, doing your best to minimise the cable’s intrusion into the light path. You can run the cable along the top or the side of the vanes

Step 6 – Collimate your Telescope

With the best will in the world and taking great care, you are likely to have disturbed the position of the secondary mirror while fitting this accessory. You should collimate your telescope regularly anyway, so this shouldn’t be an issue. There are many online tutorials for collimation. I like this one:

Using Your Secondary Mirror Heater

This heater is designed to run off 12V DC. However, there is nothing specific about this voltage, so you could run at 5V or 20 V. At 5V it would give 500mW and at 20V it would give 8W – this is too much for your mirror. Unless the conditions are extreme, we recommend using at 12V, running at 50% on your PWM dew heater controller. If you don’t have one, then running at 12V is fine.

The 50cm cable provided is short, so that it can be left attached to the telescope at all times. To use it, you probably want an extension cable – these are available online from many places at reasonable prices and at different lengths. Search for “RCA extension cable”.

Programming M.A.R.S. Rover on Raspberry Pi Zero (inc v2)

Programming the M.A.R.S. Rover with Python

Preparing your Raspberry Pi Zero

Before you can install theRover software, you will need to ensure that your Raspberry Pi Zero is up and running and connected to the internet. You will need to be able to see the desktop or console (either using direct connections, or SSH or VNC over the network).

Setting up a Raspberry Pi is not covered here. It is best to get the information from the source at Raspberry Pi

You will also need to enable SPI and I2C. Do this from raspi-config

sudo raspi-config

Select interfaces and enable both SPI and I2C. Then reboot.

Installing the M.A.R.S. Rover Python Software

First you will need to prepare your Pi for the Fireleds (fully compatible with neopixels). Install the rpi_ws281x package:

sudo pip install rpi_ws281x

Alternatively you can run Pimoroni’s curl script for their Unicorn HATs.
With your Pi connected to the internet, run (you don’t need to install the resources and examples):

curl -sS https://get.pimoroni.com/unicornhat | bash

Download the Python library module and example software for M.A.R.S. Rover with

wget https://4tronix.co.uk/rover.sh -O rover.sh

bash rover.sh

This installs the following, which should be run for a command line (not in Idle etc.)

  • Creates a folder home/pi/marsrover for all the example files and library module rover.py (the main library module)
  • calibrateServos.py should be the first program you run. This ensures that the wheels are all pointing in the correct direction. You must use the terminal to run this and you will require sudo because it uses the LEDs as indicators. Run with sudo python calibrateServos.py. Then select each servo in turn using ‘0’ to ‘4’ keys and adjust the servo using the left and right arrow keys until it is straight. Press ‘s’ to save the calibration and exit the program.
  • motorTest.py to demonstrate driving the motors. Must be run in a terminal, not from an IDE like Idle or Thonny. Use LXTerminal for this
  • servoTest.py to demonstrate controlling the servos. Must be run in a terminal, not from an IDE like Idle or Thonny. Use LXTerminal for this
  • ledTest.py flashes all LEDs through Red, Green, Blue and White. This must be run using sudo. ie: sudo python ledTest.py
  • sonarTest.py shows the distance in cm for an obstacle using the ultrasonic distance sensor mounted on the mast head
  • keypad.py shows the numeric value of each key pressed on th eoptional keypad
  • driveRover.py is a basic driving program using the arrow keys to steer and move

Remote Control of Raspberry Pi

Check out the various interface methods for your Raspberry Pi. We prefer to use Real VNC desktop client on our PC with the built-in VNC server on the Pi Zero. See the Raspberry Pi Remote Access blog and scroll down to the VNC section.

Using the rover.py Library Module

To use this module, you must first import it into your program using

import rover

Then, before using any other functions you should call the init ( ) function to initialise all the variables used by the library. The init ( ) function has two optional parameters.

1. Default brightness of the LEDs. If omitted, this defaults to 40. So the following call will initialise the library and set the default brightness to 100:

rover.init (100)

2. Using the PiBit to convert a Microbit Rover to Pi Zero. This parameter is only needed if using a PiBit and causes the pins used to drive the motors to be swapped. For a PiBit, use:

rover.init(PiBit = True), or rover.init(100, PiBit=True)

Hot Tip:
As a special case, if you set the brightness to zero, then the LEDs are not initialised. As this would require use of the sudo command, it can be beneficial to call init (0) so that your program can be run without using sudo.

When your program has finished, it is good practice to close down everything tidily by calling:

rover.cleanup ( )

Motor Functions

  • stop ( ): Stops all motors – coast slowly to a halt
  • brake ( ): Stops all motors – brakes quickly
  • forward (speed): Sets all motors to move forward at speed. 0 <= speed <= 100
  • reverse (speed): Sets all motors to reverse at speed. 0 <= speed <= 100
  • spinLeft (speed): Sets left and right motors to turn opposite directions at speed. 0 <= speed <= 100
  • spinRight (speed): Sets left and right motors to turn opposite directions at speed. 0 <= speed <= 100

Fireled Functions

  • setColor (color): Sets all LEDs to color – requires show()
  • setPixel (ID, color): Sets pixel ID to color – requires show()
  • show ( ): Updates the LEDs with state of LED array
  • clear ( ): Clears all LEDs to off – requires show()
  • rainbow ( ): Sets the LEDs to rainbow colors – requires show()
  • fromRGB (red, green, blue): Creates a color value from R, G and B values
  • toRGB (color): Converts a color value to separate R, G and B
  • wheel (pos): Generates rainbow colors across 0-255 positions

UltraSonic Function

  • getDistance ( ). Returns the distance in cm to the nearest reflecting object. 0 == no object.

    Keypad Functions

  • getKey ( ). Waits for a keypress on the optional touch keypad and returns the value of the keypad pressed. The relevant bit is set for any keys pressed (16 keys, so a 16-bit value is returned)

EEROM Functions

The onboard EEROM can store 1024 bytes of information. However, the first 16 bytes are used to stroe the servo calibration offsets, so “only” 1008 bytes are available to the user. The servo offset data is hidden, so the user data is addressed from 0 to 1007. Values return are signed bytes with values from -128 to +127 inclusive. This could be used for example to store a sequence of commands from the Keypad, creating a set of remote instructions, etc.

  • readEEROM (Address). Returns the data byte stored at user address Address
  • writeEEROM (Address, Data). Saves the data byte Data at the user address Address

Valenta Off Roader

Valenta Off Road Vehicle

For BBC Microbit

The Valenta range of motor driver boards has been specifically engineered to be used as the main control unit for a range of injection moulded vehicles.

The Valenta Zero is the same size as the DriveBit and ServoBit products from 4tronix (and also the same size as a Raspberry Pi Zero). It contains a small motor controller (DRV8833) as well as connections for general I/O and servos (can be selected to operate at 3.3V or 5V using a jumper or switch).

A Makecode extension is available to drive both the Valenta Zero and the Valenta Plus. In the Advanced | Extensions search box, enter this URL to find and load the extension: https://github.com/4tronix/Valenta

Assembly

Please follow the steps shown in this video and outlined in the included User Guide

Programming in Makecode

A Makecode extension is available to drive both the Valenta Zero and the Valenta Plus. In the Advanced | Extensions search box, enter this URL to find and load the extension: https://github.com/4tronix/Valenta

This provides generalised commands to drive motors, servos and Fireleds (where available). To drive this Off-Roader vehicle, note that:

  • Motor 1 is the left motor
  • Motor 2 is the right motor
  • Servo 8 is the steering servo connected to Pin 8 of the Microbit
  • (There are no headlights or Fireleds on this prototype)

Sample Programs

Please visit the Hummingworks website for samples at this time