Review of the Makeblock Ultimate 2.0 robotics kit

Makeblocks retail packaging

Today, we have on the review workbench (well… kitchen table) the Makeblock Ultimate 2.0 robotics kit. I was sent this kit for free from the manufacturers, but they have not vetted or approved this review, so it will be an honest account.

TL;DR

This really is an awesome kit with high-quality parts and very good LEGO/Meccano-type instructions. It’s pricey at $350+VAT/£399 inc VAT, but in this instance you really do get what you pay for. For my full opinion, go to the bottom of the page. Also at the bottom of the page is a limited-time code for 10% off!

Packaging and unboxing

The package arrived in a large cardboard box. Inside that was another (very nicely designed) box with pictures and details of the kit.

Makeblocks retail packaging

Back of the Makeblocks retail packaging

It’s a sturdy box and feels very full. Let’s get inside it and see what the kit contains!

Makeblocks Ultimate 2.0 first layer of components

This is the first layer. I can already tell this is going to be high-quality stuff. There is a mixture of metal, Perspex and what I assume is injection-moulded parts along with motors, rubber wheels and a sophisticated and nicely produced ‘grabber’.

Makeblocks Ultimate 2.0 second layer of components

Underneath a layer of foam is another load of components including miscellaneous fixings, rubber tracks, the controller board, some tools, some cables and a cardboard box which contains lots of small add-ons and plug-in boards. It really does contain everything you need except the AA batteries.

I opened up the controller board anti-static bag to have a look:

Makeblocks Ultimate 2.0 main controller board

It’s a very impressive controller board with, seemingly, everything broken out to ports and pins.

In terms of motors, there’s a micro DC motor embedded in the grabber, so I left that alone. There are also three DC motors of the barrel type, with attached encoders, of different torques and gear ratios:

Makeblock 3 x motors

That’s enough of an unboxing. Let’s look at the technical specifications of the kit.

Technical specifications

Going from the Makeblocks product page, I can tell you that the metal parts of the kit are anodized aluminium and that there are over 550 pieces. The main controller board is driven by an ATMEGA2560-16AU (which explains the plethora of ports and pins available on the board) and that the kit includes the following add-on boards:

  • 4 x motor driver plug-in boards.
  • Ultrasonic sensor.
  • Line follower sensor.
  • 3-axis accelerometer and gyro sensor.
  • A shutter controller for a camera (one of the models you can make is a ‘camera dolly’ – I haven’t got a compatible camera, but for those that have, this is pretty cool!)
  • A Bluetooth module that can be plugged into the main controller to give you wireless control.

Listed under interfaces on the page are the following:

  • DC Motor Interface × 8
  • Motor Driver × 4
  • Servo Interface × 10
  • Wireless Communication Module × 1 (this is the Bluetooth module I just mentioned)
  • Power Output × 2
  • Raspberry Pi Communication × 1 (not too sure what they mean, but maybe that will become clear! Serial, maybe?)
  • Sensors or Modules Interface × 4

They list that the power supply is 12V, which is interesting because the included battery box is for 6 x 1.5V AA batteries – which is 9V. Perhaps it can take up to 12V – this would be useful to give the robots a bit more “grunt”.

Programming

It also lists that you can use Scratch to program the robots (it’s actually their version of Scratch called mBlock 5) and also “Arduino” which I assume means Arduino’s flavour of C. It would have been nice to be able to use Micropython, but I guess you can’t have everything.

Certainly, seeing as they state that the board is usable from a Raspberry Pi, you could use full-size Python to communicate with the ATMEGA chip. Instructions on how to connect and use it with a Raspberry Pi are here. (There’s also some stuff on GitHub as well, but I suspect they’re outdated and are replaced with the previous link!). It looks like it can be connected with a soldered-on header block or a USB cable (which is included), so we’re talking communication via serial link.

So far, so good in the case of components – it’s an Arduino-driven kit, so at least it will be familiar to adult makers (if not as user-friendly as Python), but there is the visual programming environment as well, so that will appeal to kids. Let’s move on to where the kit really takes off – the instructions!

Instruction manual

The instruction manual is a paper-and-staples affair, but it’s pretty thick and includes instructions for making three different types of robot as well as ideas for many more.

Makeblocks instruction manual cover

The instructions are clear, in a LEGO/Meccano way. In fact, the whole kit is reminiscent of Meccano, but a lot sturdier.

Makeblocks instructions sample page

Makeblocks instructions sample page

As you can see, where necessary the instructions are in English but mostly it is done using illustrations. There is a handy reference page (corner hastily folded down by me!) to help you to make sure that you’ve got the right sized part out of the different ones available. It can be very easy with this kit to pick the wrong screw or piece of metal, so always compare it to the 1:1 example pictures!

I thought the instructions were very good. It took me a few hours to build the crane/grabber robot, although I was taking pictures as I went along, as you will see…

Initial build of the crane/grabber

Getting ready to start building

I was pretty fastidious doing this, and I think you have to be when it comes to this kind of kit and instructions. This first robot gives you a lot of the skills needed to be able to freestyle later, particularly how and when to use grub screws! That’s right – there are tiny grub screws to secure wheel hubs to the metal axles. You need a good level of motor control and attention to detail. I would say this isn’t a suitable kit for the very young on their own, for example, but certainly a child of, say, 8-10 with parental help would get along just fine with it.

Later on in the build - main base built

One thing I particularly liked was that it tells you when you’re 50% of the way through, and 80% (although that’s pretty obvious!). This really helps you to divide your time and estimate how long it will take.

Arm assembly

However, I will give a little criticism here. I did manage to mount the first arm piece (with the black wheel on it) the wrong way around – they frequently switch the viewpoint of the 3D illustrations so that sometimes the front is at the front, and sometimes it’s towards the back in the pictures. There are plenty of clues, but if one person (me!) managed to do it wrong, and I was really concentrating, then it’s just something to be aware of!

Finished robot

This is the completed crane/grabber (with the main lift wheel on the correct side!) As you can see, it’s really quite large!

It takes 6 x AA batteries (which aren’t included) and that connects to the controller board with a barrel jack, so if you wanted to you could change it for a different sort of battery, even a LiPo (I even used it tethered initially to make sure everything worked), but for now I just shoved in some Energizer batteries.

Video demo time!

Here’s a video of the robot I built in action. In this video, I am using the Android app on my mobile phone to remote control the robot.

This is just one robot build, of course. Here’s a selection of all the other robots that you can build with the kit, courtesy of Makeblock:

Clearly, this is all using a remote control (phone) at this point. However, they do include an ultrasonic distance sensor and a line follower sensor which you can use together with your robot build and some programming to do object detection and line following. If you paired it up with a Raspberry Pi (this is advanced level stuff!), you should be able to take input from a Pi camera to move towards, or avoid, specific objects/colours. It’s entirely up to you, and this kit will grow with you, allowing you to explore such ideas.

Opinion

In my opinion, this is one of the most comprehensive robotics kits out there. It’s not called “Ultimate” for nothing. It allows you to build a wide variety of robots, from those in the instruction manual to creations of your own. The ability to reprogram the robot to do your bidding is more advanced, but using the Scratch-alike visual programming environment will be familiar to kids and the use of Arduino C is familiar to most makers. If you pair it with a (admittedly hard to find, physically, at the moment) Raspberry Pi, you’ve opened up a whole new world of physical programming possibilities. There’s a whole load of programming instructions here.

The price – £399-ish (including VAT) in the UK, $350+VAT in the US or overseas, is very top-end. However, considering the sheer number of parts, the custom MegaPi Arduino board and the quality on display, I can understand how they justify that. It’s a complete robotics lab, if you like, and I can see this going down well in well-off families and private schools looking for a kit to use in class.

I’m looking forward to passing the kit on to a friend of mine who has two young children and seeing how they get on with it. Certainly, the proof of the kit’s quality and ease-of-use lies not in my hands, but in the hands of the young and in the hands of parents. Therefore, expect to see a follow-up review when my friend manages to get some time to look at the kit with his kids.

On the whole? Highly recommended if you can afford it!

Buying the kit

The kit is available from several retailers (make sure you get the v2 kit!), but Makeblock themselves have an Amazon store you can purchase from.

Until the end of April 2023, you can get the kit for £319.99 off by:

  1. Ticking the “Apply 10% voucher” box on Amazon.
  2. Using the code JIJEMVVV which gives you another 10% off.

Review of the Elecrow CrowBot BOLT – a fun autonomous and remote control robot kit

The CrowBot BOLT

Nicole over at Elecrow got in touch with me about a new robotics kit they’ve been developing called the CrowBot BOLT. I agreed to review the product and give my honest opinion.

TL;DR

A really well thought-out, and well-produced, kit from Elecrow. A few problems with the language in the documentation aside, it is a valuable learning product for both young and old. You can buy the kit from Elecrow here.

Packaging

The whole kit comes in a box with protective foam on the inside. Very high quality packaging, suitable for a retail environment.

What’s in the box?

  • Components to make the CrowBot BOLT including two ESP32-based circuit boards – one for the BOLT, one for the joystick.
  • Components to make the joystick controller for the BOLT.
  • An instruction manual for assembly of the BOLT.
    Annoyingly, it doesn’t come with instructions for the joystick, but once you’ve put the robot together, you kind of get the idea!
    The instruction sheet has a line follower course on the reverse, though, which works very well!
  • A USB-C cable
    I was pleasantly surprised that it was USB-C.
  • A screwdriver
    Handy
  • An IR remote for the BOLT.
    However, no battery in it, even though the plastic tab is there to release the battery… Bit annoying, that, as I don’t have any of those batteries, but they’re easily available.
  • Some expansion cables for connecting up other sensors
    I didn’t try this but on the reverse of the main chassis/PCB, there are ports for both analog input and I2C input.

Features of the BOLT

  • 2 x GA12-N20 Micro DC gear motors
    I’m not sure on the RPM of the motors. All I can say is… they’re quite zippy, and have a decent amount of torque, so a good balance.
  • Line following sensors.
  • Distance sensor/object avoidance
    This sensor has LEDs built into it – first time I’ve seen that!
  • Light detection
    This is so the robot can follow a torch, or other light source.
  • A buzzer
    A…surprisingly loud buzzer!
  • Bluetooth connection for remote operation.
    The joystick operates over Bluetooth, so that’s what that’s for. However, do make sure you’ve switched the DIP switches to the correct mode for Bluetooth.
  • Wi-fi onboard.
    This isn’t covered by the tutorials and it is left to the user to get the Espressif-based boards working themselves, which is fair.
  • Some under-chassis Neopixel-like LEDs.
    Well, it’d be disappointing if there weren’t some blinkies.
  • Infrared receiving ability for the small remote control which has been enclosed.
  • Ability to be programmed using the Letscode visual programming environment, Arduino IDE and MicroPython.

Assembly & impressions

All the Perspex (and I do mean every single little bit!) is covered in protective paper. So, that’s your first job. I found it easy enough to do it once I remembered to use the small screw driver blade to scrape at the edges of the paper. This gives enough purchase to slooooowwwwwly peel them off.

The instructions are pretty clear for the assembly of the robot, and I was able to follow them without much trouble. I did find that I needed at least four hands when it came to fitting the battery box into slots on the rest of the parts all at the same time, but it was doable. The whole thing took about 20 minutes, which I think is acceptable. Smaller hands may need adult supervision or an extra pair of hands!

This is what it looks like when almost completed. That small piece in the background at the top is the front plate, which I missed first time.

One small thing: although it looks better as built, the batteries are inaccessible once installed without taking the chassis apart. This is okay-ish, as I’m sure the batteries will last a while, but it is something to bear in mind. It would have been interesting if the battery box could be mounted either way up – it just would have needed a slot to get the connection cable through the custom plate that the battery box is attached to.

Joystick

The Joystick comes in bits:

Once peeled and separated, it’s just a case of putting it all together with the circuit board sandwiched between the two large pieces of Perspex, given strength by spacers and screws. The joystick comes with a small OLED display which plugs in before you put the top layer of Perspex on. This gives you an idea of what “mode” you’re in, driven by presses of the various buttons. If you want to make the robot come to a dead stop, centre-press the main joystick knob. That caught me out – lack of instructions here giving me a few nervous “catch it before it falls off the table” moments!

Oops! Forgot to take my own shot, so here’s a promo shot from Elecrow!

Opinion and Who is it For?

I liked the kit a lot. The instructions, as given, were very good, with a high standard of clarity throughout. I felt that a small space should have been given over to instructions for the joystick, but that’s a very minor thing.

Programming it is simple enough with MicroPython an option, though younger hands may prefer Letscode, which is a visual programming environment. I did have a few teething problems with ports using Letscode, but nothing that a little perseverance couldn’t cure.

The joystick is really well thought out and has demo code on it which use all the included sensors as well as giving you the obvious remote control option.

The excellent beginners’ guide helped greatly, getting the environment on my Windows laptop set-up and then going through a lot of examples and instructions to get the most out of the robot. There is a lot of learning here, a lot of it pictorial form, and a lot of fun with the included joystick functions and the simple-to-understand tutorials.

The level of English is satisfactory, I would say, rather than outstanding. You might find that, as a parent, you need to interpret some of the language. This is a shame as I would have thought getting a native English speaker to read through the documentation first would be a relatively simple thing, given the size of the maker/coding community. That might be something Elecrow could consider next time they release something like this.

Cost

The price of the kit with joystick is $58, $35 without it. I think this is fair, as the engineering is certainly top-quality, as are the rest of the parts. The documentation that comes along with it is also valuable, and is sure to be a lot of fun for the tech-minded, both young and old.

Overall

As I said at the top of the post, this is a really well thought-out, and well-produced, kit from Elecrow. A few problems with the language in the documentation aside, it is a valuable learning product for both young and old. You can buy the kit from Elecrow here.

Demo video

Here’s me turning both the robot and the joystick on and setting the robot to follow the black line on the back of the instruction sheet:

Useful links

Maker Advent Calendar – 12 days of Codemas – from The Pi Hut

Advent Calendar box

All about the calendar

Arriving just in time for Christmas, The Pi Hut’s Maker Advent Calendar contains all sorts of maker-y goodness to enhance the Festive season. The Calendar comes as a large box with a cardboard wrapper and will make an excellent gift – the packaging is just so lovely, and definitely on the “cute” side. Inside the main box, you will find 12 small boxes with tabs to help you pull them out. Inside each of those smaller boxes is the contents of the Calendar. The initial box, number 1, contains a Raspberry Pi Pico H (that’s the one with the headers already soldered on), a USB cable to plug it into your computer, and a breadboard.

Box number 1

Little boxes, little boxes

Subsequent small box contents then add onto those basic building blocks to help you explore lighting up LEDs, reading button presses, detecting sensor changes and much more. I’ve taken a look at the contents of each of the smaller boxes (which you can find here, if you really must and if you want to spoil the surprise!). For your £40, you certainly get a lot. Some people have said it’s a bit expensive, but I actually find it to be “about right”.

The Pico H pokes out of its box

Adorable, isn’t it? The Pico H comes in its very own anti-static box!

Of course, no box/kit worth its price tag would be without written material to go along with the components. The Pi Hut have promised that the material will be available from 1st December, and it’ll be interesting to see what they come up with. It might have been a good idea to have the first few pages available before, just as a preview, but I expect they’re still working on them at the moment.

Getting the kit

I look forward to getting “stuck in” with the Calendar, its components and the worksheets. It’ll be interesting to see whether they go for MicroPython or CircuitPython!

The Calendar is still available for pre-order for the next few days and you can find it here.

Elecrow Raspberry Pi Pico Advanced Kit review – lots of goodies!

I received this kit for free from Elecrow in China in exchange for an impartial review.

TL;DR – an amazing kit for the money, but the tutorials could use some attention.

The contents

This kit is large and full of good components. Most will be familiar to you if you’ve ever bought a 32-module kit for the Arduino. There are similar components, but they are of decent enough quality and come in a great plastic carry case. The kit contains the following:

  • 1 x Raspberry Pi Pico, pre-soldered (except for the debug pins).
  • 2 x 400-hole breadboards.
  • Some 5mm LEDs.
  • 1 x RGB LED module.
  • 1 x button.
  • 1 x sound sensor.
  • 1 x mini PIR motion sensor.
  • 1 x photoresistor LDR module.
  • 1 x laser diode transmitter.
  • 1 x passive buzzer.
  • 1 x vibration sensor.
  • 1 x mini magnetic spring module (reed switch).
  • 1 x soil moisture sensor.
  • 1 x potentiometer module.
  • 1 x small DC motor.
  • 1 x fan blade.
  • 1 x 9G servo.
  • 1 x dual-axis, centre button joystick module.
  • 1 x RC522 RFID module.
  • 1 x 4-bit digital LED display module.
  • 1 x traffic light module.
  • 1 x rotary encoder module.
  • 1 x 1602 LCD display module, blue, with I2C backpack.
  • 1 x DHT temperature & humidity sensor.
  • 1 x rainfall sensor module.
  • 1 x flame sensor.
  • 1 x small OLED module.
  • 1 x membrane switch module.
  • 1 x robot chassis with wheels, motors, 2 x line sensors etc.
  • 2 x crash sensors/limit switches.
  • 1 x ultrasonic distance sensor.
  • 1 x infrared remote control.
  • 1 x Infrared receiver module.
  • 1 x 30cm micro USB cable.
  • 1 x 170-hole breadboard.
  • Jumper wires / Dupont cables.
  • Stand-offs, screws and nuts.
  • Flat/Phillips dual-ended screwdriver.
  • 1 x small magnet.
  • 1 x DC stepper motor driver board.

It’s quite overwhelming, actually! The nice thing is that, even after I removed all the pieces and debagged them, they all fit back in the plastic case quite easily, without too much trouble. The components all seem solid, and using them in combination with each other opens up some exciting possibilities.

The one warning I would give is that although almost all the components can be used without soldering, a couple of them, like the small motor for the fan and the RFID module, will require a small bit of soldering. Just something to be aware of, and it would have been nice if the whole thing had been solderless.

Tutorials

You can view the PDF of the tutorials here. As you’d expect from a Chinese-made kit, the English isn’t brilliant, but you can make sense of it with a little concentration. What they could really do with is someone with a thorough grasp of the language to knock it into shape so that it’s suitable for all ages and skill levels. The programming is in MicroPython, so you’ll need to get to grips with the Thonny editor. Alternatively, there’s a visual programming environment available here that might be worth a look for young programmers, especially. The great thing about all these components, of course, is that you can easily adapt the programming to use CircuitPython or C, depending on your particular skills, and there are plenty of other tutorials out there that will enable you to use the different components in various ways.

Buying & Overall

The cost on the Elecrow website is currently around $38 (occasionally, they reduce the price slightly). This represents extraordinary value, it really does, and you can order it with or without the Raspberry Pi Pico board. There are numerous shipping options available, the cheapest of which is a little over $11 to the UK, which is pretty good. FedEx is $23, which may represent a more reliable way of receiving the kit. I don’t know how much customs charges will be on import, so that’s something to be aware of. It’s possible that as the kit matures that other suppliers in your local area will start to stock the kit.

As I said, the kit represents very good value for money. The components all seem good, and the fact that they contained within a plastic case is a great idea as it keeps it “all together” which, for education and hobbyists, is key to not losing bits! The tutorials could use some work, just because of the scattershot English, but the code looks sound.

Overall, I would recommend the kit with these reservations. Well done, Elecrow!

Use Adafruit IO with a Raspberry Pi Pico W to create IoT dashboards using MQTT

I decided recently to set up a string of temperature sensors around our house to work out the temperature profile of different rooms.

With the recent release of the Pico W, I realised that I could do this quite simply, as long as I could find a way to “nicely” display the data.

You’ll have read my exploits with Anvil last week, I expect, and saw that I didn’t have much luck. However, I knew that Adafruit had their very own IoT platform – Adafruit IO – and that it had been around awhile, so I thought I’d give that a try and document it.

Set-up your Adafruit account

Go to https://io.adafruit.com/ and register an account if you don’t have one. You’ll be creating Feeds and Dashboards in a bit.

Assemble your hardware

For this project, I’m using:

  • A Raspberry Pi PicoW
  • An Adafruit AHT20 I2C temperature and humidity sensor

As you can see, I’ve soldered them together. I’ll put a 3D printed case together at some point, I’m sure.

Assemble your software

For this project, I’ve used Micropython for the PicoW and then loaded the Pico up with an MQTT client and an AHT library as follows:

The code

The code is in several files and can be found on my GitHub repository.

  • main.py – the main code that holds it all together
  • config.py – defines the “name of the device” by way of a “feed prefix” which is used to tie the Adafruit IO feeds together with the device.
  • secrets.py – credentials etc. There’s a sample secrets file in the repository so you know what to put in it.
  • The two libraries as mentioned above.

Adafruit IO set-up

Set-up your config.py with a feed prefix – this can be anything by mine’s called temp_sensor_1.

Then, create two feeds in Adafruit IO: <prefix>_temperature and <prefix>_humidity. For example, temp_sensor_1_temperature etc.

Create a dashboard by adding Graph boxes that bring in those feeds.

Output

In theory, running the script through Thonny should show you the sensor readings as well as connection success/failure for wifi and notification of when the readings are published via MQTT to Adafruit IO.

You should end up with something like this on Adafruit:

Questions

If you’re trying to do this, you probably have questions – leave a comment and I’ll try and get back to you! 🙂

Use the Anvil IoT service to collect data from your Raspberry Pi Pico W

Anvil is a web app builder website that has just launched a new “IoT Toolkit” for the Raspberry Pi Pico W called the Pico Uplink. By downloading their UF2 image (which is MicroPython-based), you will be able to send data to their site and then create your own dashboard to view the data that has been collected.

What do I do?

First of all, take a look at their announcement blog post. This will give you a fair indication of whether their offering is suitable for what you’re trying to do. After that, take a look at their Pico page here.

You will need to sign up to Anvil – it is free to start with, but there are Pricing plans to take a look at if you’re going to use it in anger.

The following steps are part of their Get Started guide. I’ll write my observations as we go.

Get the firmware

Once you’ve confirmed your email address, you will need to download their UF2 firmware for the Pico W.

Make sure that you download the “complete” UF2 initially, then the Firmware only version after you’ve started writing your custom code.

Put your Pico W into bootloader mode (pull the power cable, press BOOTSEL and then plug it back in) and then drag the UF2 file to your Pico “drive”.

Interestingly, this gives you a PICO_W drive showing the code. This is how CircuitPython works, so it’s interesting to see this variant of MicroPython do that, too. Normally, you can only access it using Thonny, but this looks like you can get to the files through your File Explorer. For now, we’ll just use Thonny and see how we go!

Now, we’re going to use the Anvil Editor to build our “app”. This is using the beta version of their new version, so it will be interesting to see if it works! 🙂

As instructed, I created a Blank App using the Material Design theme.

I clicked the + icon, chose Uplink and then clicked Enable server Uplink. This gave me a long Uplink key. I copied this and pasted it into main.py on the Pico W for safe keeping. Later on, I suspect I will want to put it into a config file and use a .gitignore file so that it’s hidden from GitHub.

For now, I’m ignoring the Python examples, but it could be potentially confusing if you’re not using full Python to see that!

Connecting to wi-fi and to Anvil

As instructed, I opened up boot.py and put in my wi-fi SSID and password. (This gave me something of a dilemma as my wi-fi is a bit spotty in the office!)

Having already put my Uplink key in boot.py, I knew I was ready to go.

I pulled the power and then re-inserted it. The LED went solid then flashed rapidly. This, according to the instructions, is what I was looking for as it means the wi-fi connection and the Anvil Uplink both work.

If you want to re-run the code in Thonny, make sure you’re on main.py when you hit F5 as doing that with boot.py means it doesn’t “move on”.

Create an action button

In the Anvil editor, I dragged a button into the main window and gave it the code as instructed:

def button_1_click(self, **event_args):
  """This method is called when the button is clicked"""
  anvil.server.call('pico_fn', 18) # Choose any number you like!

I then ran the Anvil app, clicked the button on the right hand side and saw the Pico’s onboard LED flash rapidly! That’s exciting – clearly the Pico W is polling Anvil somehow to see if something’s been clicked to activate the code.

Publishing the app

I want this on the web as a public app. I clicked Publish and then chose to get a Public URL. It gave me the URL, bizarrely and randomly: https://big-tinted-jump.anvil.app. Apparently, you can change that to something else if you want, which is neat.

I then accessed that public URL and, lo and behold, by button flashes my Pico W LED.

What next? Internet of Things data display!

Well, that’s interesting and simple, but it’s not really “Internet of Things” as I understand it. For that, I need sensors to be sending data to Anvil, store it there and display it on a dashboard.

Fortunately, the Pico has an on-board temperature sensor. Now, it’s not great for taking the temperature of the surrounding air, but it will give you a reading of the temperature of the board itself. Here’s the code:

from machine import ADC

sensor = ADC(4)
conversion_factor = 3.3 / 65535
temp_reading = sensor.read_u16() * conversion_factor
real_temperature = 27 - (temp_reading - 0.706) / 0.001721
print(real_temperature)

So, I added that to my main.py and it printed out 29.85… which is a reading, ignoring how accurate for a moment.

How do I get that to Anvil?

First of all, in the Default Database, I created a new table called temperature_readings with three fields: source, temperature_reading and reading_date_time.

Then, I added a new Server Module and wrote a new function based on the Advanced Tips page.

@anvil.server.callable
def record_temperature(source, temperature_reading):
  app_tables.temperature_readings.add_row(source=source, temperature_reading=temperature_reading, reading_date_time=datetime.now())

This should, if I’m correct, be a function which records into the new table anything I ask it to. I included the “source” column so that I could have multiple temperature sensors stored in the same table. I’m hoping that’s the write approach!

I then created a button which would call the Pico and tell it to get the temperature sensor data from the Pico and put it in a table:

def button_1_click(self, **event_args):
  anvil.server.call('record_visitor')

This is great, of course, but what I really want is for the Pico to push the data to Anvil, not do it “on request”.

So, I think what I need is some kind of scheduler on the Anvil side to poll the Pico. Let’s see, what can I find with a quick Google:

Ah. Scheduled Tasks. From reading the page, it’s clear that that is what I want – to poll a sensor using the Uplink functionality. BUT!

Scheduled Tasks are available on the Personal Plan and above. £10 a month. Oh. Guess I won’t be able to then! Oh well. It’s useful, then, if you just want to poll-on-request, but not for gathering data… At least, not unless you pay.