Here is a list of the posts in this challenge
Gr0G - 03 - High-pressure system design
Gr0G - 07 - Playing with the Gertbot
Gr0G - 11 - Building the box (2)
Gr0G - 12 - Building the high-pressure system
Gr0G - 13 - Building the high-pressure system (2)
Source code available at https://github.com/ambrogio-galbusera/gr0g, https://github.com/ambrogio-galbusera/gr0g-ble-android and https://github.com/ambrogio-galbusera/gr0g-ble
In this post I will start to play a little bit with the Gertbot board
Preliminary operations
Besides the "typical" tasks you have to work out when you boot a Rapsberry Pi for the first time (like, for example, expanding the filesystem, updating software components etcetera), there are a couple of other things to make the Gertbot board work properly
Disable serial console and enable UART
The internal serial console must be disabled to free the serial port for the Gertbot (as a matter of fact, Raspberry Pi communicates with the Gertbot board using the UART0, which is typically used as a Linux serial console).
By default the serial port on the Raspberry PI is configured for console input/output
To disable Linux serial console and enable UART, you have two options. The second option is actually less straightforward, but I like to understand what happens behind to scene and maybe someone could be interested as well
- run raspi-config, navigate to Interfacing options, then Serial.
When asked if you want to be able to access from a serial console, select No, When asked if you want to enable serial hardware, click Yes
OR
- Open /boot/cmdline.txt and edit it to disable boot info being sent to the port.
sudo nano /boot/cmdline.txt
Remove the following string from the kernel command line
console=serial0,115200
Save the file with CTRL-O and CTRL-X to exit nano.
Edit file /boot/ config.txt
sudo nano /boot/config.txt
and append a new line at the end of the file
enable_uart=1
Save the file with CTRL-O and CTRL-X to exit nano.
Disable Bluetooth
Bluetooth may use UART port, so it's a good idea to disable it completely. To accomplish this, edit /boot/config.txt
sudo nano /boot/config.txt
and append
dtoverlay=pi3-disable-bt
Reboot the board
sudo reboot
to apply the changes
First application
I created a simple application to test PWM output. I connected a 12 Volt power supply and a fan
Then I downloaded the Python library from
https://www.gertbot.com/gbdownload/rev2.8/python_code.tgz
and untared the file
tar xzvf python_code.tgz
There are many samples included in the tgz file, but I will create a very simple application to get familiar with the library itself
I created a new folder for my application, and here I copied file gertbot.py from the folder where the library archive was extracted. Finally, I created a simple application
In this application, I simply
- initialize the output
gb.set_mode(board,channel,gb.MODE_BRUSH) gb.move_brushed(board,channel,gb.MOVE_B)
- set the PWM frequency and the duty cycle to vary fan speed
gb.pwm_brushed(board,channel,freq,dc)
- switch off the PWM
gb.set_mode(board,channel,gb.MODE_OFF)
Here is the result (I hope the fan speed is visible in the video)
Hooray! Another step in this challenge!
As soon as my local warehouse will have a 1/4 inch female Tee available, I will start testing the compressor and the atomizer. In case of delays, I will make the final touches to the box or install the LED
BTW, I created a github repository where I will push all the source code I will develop for this challenge. The repo is here